Need help on a code part for signal processing.

Hello everyone i have an exercise for signal processing course im taking and our homework's solution is this code. Looking at the graphics i can confirm this answer is true. But I'm having a hard time to understand some parts of the graphics.
%matlab
ts=0.0001;
to=0.1;
t=0:ts:to;
m=sinc(100.*t);
fc=250;
c=cos(2*pi.*fc.*t);
u=c.*m;
subplot(211);
plot(t,m);
xlabel('t');
ylabel('m(t)');
subplot(212);
plot(t,u);
xlabel('t');
ylabel('u(t)');
f=linspace(-1/(2*ts),1/(2*ts),length(t));
M=fftshift(fft(m))./length(t);
U=fftshift(fft(u))./length(t);
figure
subplot(211);
plot(f,abs(M));
xlabel('f');
ylabel('|M(f)|');
subplot(212);
plot(f,abs(U));
xlabel('f');
ylabel('|U(f)|');
so this is the solution to my code. this code provides me these graphics.
Look at figure 2. U(f) and M(f) is between (0-0.06) and (0-0.08), respectively. If i change the T0 to 0.4 like this;
ts=0.0001; to=0.4; t=0:ts:to;
U(f) is between 0-0.015 and M(f) is between 0-0.03. can anyone tell me what causes these changes. The only part i didn't understand from the code. thank you all of you for your time.

Réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange

Question posée :

le 24 Nov 2020

Modifié(e) :

Rik
le 24 Nov 2020

Community Treasure Hunt

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

Start Hunting!

Translated by