how to make frequency shifting on simulink
10 次查看(过去 30 天)
显示 更早的评论
if i have two sin waves block on simulink the first with variable frequency assume 10:30 hz and the second with fixed frequency f1 how to make the first with 10+f1:30+f1 i used frequency offset but it shift signal with f1 not center signal example sin(3t)*sin(4t)=a*cos(7t)+a*cos(t) i want only cos(7t) without filtering thanks
0 个评论
回答(2 个)
Veera
2023-11-8
clc
clear all
close all
syms t w a
% Define the input signals
x1 = exp(-t) * heaviside(t);
x2 = dirac(t);
% Compute and display Fourier transforms
X1 = fourier(x1, w);
X2 = fourier(x2, w);
disp("Fourier transform of signal 1:")
pretty(X1)
disp("Fourier transform of signal 2:")
pretty(X2)
% Sum of Fourier transforms
X_sum = X1 + X2;
disp("Sum of Fourier transforms of signal 1 and signal 2:")
pretty(X_sum)
% Define frequency-shifted signals
x_left_shift = exp(-t) * heaviside(t) * exp(-a*t);
x_right_shift = exp(-t) * heaviside(t) * exp(a*t);
% Compute and display Fourier transforms of frequency-shifted signals
X_left_shift = fourier(x_left_shift, w);
X_right_shift = fourier(x_right_shift, w);
disp("Fourier Transform of frequency shift left signal is:")
pretty(X_left_shift)
disp("Fourier Transform of frequency shift right signal is:")
pretty(X_right_shift)
0 个评论
Veera
2023-11-8
clc
clear all
close all
syms t w a
% Define the input signals
x1 = exp(-t) * heaviside(t);
x2 = dirac(t);
% Compute and display Fourier transforms
X1 = fourier(x1, w);
X2 = fourier(x2, w);
disp("Fourier transform of signal 1:")
pretty(X1)
disp("Fourier transform of signal 2:")
pretty(X2)
% Sum of Fourier transforms
X_sum = X1 + X2;
disp("Sum of Fourier transforms of signal 1 and signal 2:")
pretty(X_sum)
% Define frequency-shifted signals
x_left_shift = exp(-t) * heaviside(t) * exp(-a*t);
x_right_shift = exp(-t) * heaviside(t) * exp(a*t);
% Compute and display Fourier transforms of frequency-shifted signals
X_left_shift = fourier(x_left_shift, w);
X_right_shift = fourier(x_right_shift, w);
disp("Fourier Transform of frequency shift left signal is:")
pretty(X_left_shift)
disp("Fourier Transform of frequency shift right signal is:")
pretty(X_right_shift)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!