trying to make fourier transform of 3 pulses but the sampling is bad, how to fix it?
1 view (last 30 days)
when i try to make fourier transform of 3 pulses the resault doesn't look so good but when i make fourier transform of only one puls it's fine, please help. this is my code:
David Goodmanson on 3 Jul 2017
Thanks for posting solid code. For an fft, to make the frequency grid n times finer, the boundaries of the time record (tmax, tmin) have to be increased by a factor of n. What you have now is
ts=0.001; fs=1/ts; x=-10:ts:10; % 2e4+1 point fft
These particular pulses do not have to be described by anything as fine as ts = .001, so you could try, for example
ts=0.1; fs=1/ts; x=-100:ts:100; % 2e3+1 point fft
ts=0.01; fs=1/ts; x=-100:ts:100; % still 2e4+1 point fft
ts=0.001; fs=1/ts; x=-100:ts:100; % keep .001, 2e5+1 point fft
with in all cases
plot(f,abs(yf),'o-') % zoom in to see points per oscillation
Widening the time record by a factor of 10 cuts down the duty cycle of the pulse by that factor, so the frequency domain amplitude is down by 10 (but the shape has not changed). All three of the examples have the same finer frequency grid spacing, but they have progressively more extensive frequency grids.