From: Jerry Avins on
rsk wrote:
> All
>
> This might have been discussed multiple times. However, I am new comer to
> the site.
>
> My question is given below. I wanted to put plots but could not find the
> way to do it.
>
>
>
> I took a sine curve from 0-1 s( 1Hz)and 'fft'ed it in MATLAB. I get unit
> magnitude at 1 Hz as expected. Sampling rate 1024.
>
> Then I zero padded it till 2 sec. So, total lines = 2048. The fft then
> showed major peak(0.5 magnitude) at 2 Hz with other higher frequencies
> present.
>
> All articles on zero padding say that, zero padding does not add more
> information but just makes existing information more fine. Going by that,
> the fft in second case should also have shown peak at 1 Hz. May I know
> where did I go wrong?
>
> In Summary, should there be a difference in the usual sine wave and zero
> padded sine wave with respect to frequency spectrum?

You tell us what you intended to do, but I can't analyze your result
without knowing what you actually did. I can guess, though. Have you
misinterpreted the frequencies associated with the bins in the second
case? zero padding will make twice as many bins, so what was 1 Hz before
becomes 0.5 Hz after padding.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
From: Jerry Avins on
rsk wrote:

...

> I am still confused with the outcome. Did you mean, even if I got 0.5 Hz as
> the frequency, it is actually 1 HZ?. Also, why did the amplitude change?

An FFT provides a series of numbers in sequence. Doubling the count of
the input data doubles the count of the output data. How is a frequency
assigned to a particular output datum? Hint: the answer depends on the
sampling frequency and the time interval. Zero padding effectively
doubles the sample rate.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������