how to make frequency shifting on simulink

10 views (last 30 days)
mohamed  al-asklany
mohamed al-asklany on 2 Mar 2014
Answered: Veera on 8 Nov 2023
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

Answers (2)

Veera
Veera on 8 Nov 2023
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)

Veera
Veera on 8 Nov 2023
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)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!