fourier transform of Rectangular pulse
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hi guys. i want to find fourier transform of Rectangular pulse with "fourier" order and i wrote this code:
close all
clear all
double T
T=-10:0.01:10;
f=1*(T>=-1 & T<=1);
plot (T,f)
axis([-3,3,-0.5,2])
FT = fourier (f);
ezplot (FT)
the result:
this is more info:
0 comentarios
Respuestas (1)
Walter Roberson
el 12 de Jun. de 2019
fourier() is the routine from the symbolic toolbox whose primary purpose is to take the fourier transform of formulas .
You do not have a formula, you have double precision data. That calls for fft()
Note: fft() assumes that what you have is infinitely repeatable, that it is a periodic signal. I suspect that if you were to place two copies of your f beside each other and were to look very closely, that you would see that you do not have the period you were expecting. To get the period you are probably expecting, you would have to cut T short by one sample on either the left or the right.
For example it is common for people to do something like sin(linspace(0,2*pi)) and fft that. However, this both begins and ends with 0, and if you were to put two copies beside each other you would get a [0 0] in the middle. To get a continuous signal you would do something like,
T = linspace(0,2*pi);
T(end) = []; %now it does not return to 0
fft(sin(T))
0 comentarios
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!