how to make frequency shifting on simulink

조회 수: 1 (최근 30일)
mohamed  al-asklany
mohamed al-asklany 2014년 3월 2일
답변: Veera 2023년 11월 8일
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

답변 (2개)

Veera
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)

Veera
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)

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by