DSPRelated.com
Forums

Re: Discrete Fourier Transform of a signal containing only dirac impulses

Started by Jeff Brower September 21, 2006
Mirco-

> It's perhaps a silly question, but I don't see what I'm doing wrong. I'm
> trying to calculate the FT of a signal containing only dirac impulses. To
> avoid aliasing I first low pass the signal with a Butterworth filter

Why will there be aliasing in a signal with pulses? If you look at a magnitude plot,
you should get something like a dense comb filter. One pulse would give you a flat
line.

What are you expecting?

-Jeff
> (should I take another one?) and than use the matlab function "fft" to
> transform the signal. Here an example:
>
> %The signal with two pulses:
> x=[zeros(1,1000) 1 zeros(1,800) 1 zeros(1,199)];
> tStep^-3;
> t=-1000*tStep:tStep:1000*tStep;
>
> %Filtering the signal with a butterworth filter
> [b,a] = butter(10,0.8);
> y = filter(b,a,x);
>
> % The fourier transformation
> Yt(y);
> f=1/tStep*(0:round(length(Y)/2))/(length(Y));
> semilogy(f,abs(Y(1:round(length(Y)/2)+1)))
> ylim([10^-4 10^1]);
> xlim([100 200]);
>
> I'm not sure if this is correct: If I do the FFT of the same signal without the low pass filtering first, like this:
>
> %The signal with two pulses:
> x=[zeros(1,1000) 1 zeros(1,800) 1 zeros(1,199)];
> tStep^-3;
> t=-1000*tStep:tStep:1000*tStep;
>
> % The fourier transformation
> Xt(x);
> f=1/tStep*(0:round(length(X)/2))/(length(X));
> semilogy(f,abs(X(1:round(length(X)/2)+1)))
> ylim([10^-4 10^1]);
> xlim([100 200]);
>
> the result seames to be the same! Where is the aliasing? What is the error in my reasoning?
>
> Thank you for your help!
>
> Mirco