> Thank you for the response!
>
> What do you mean by "Y value"?
>
> For example:
>
> x=data(1:1024);
> y = fft(x, 1024);
> y2 = fft(x, 2056);
> y_mag = y.*conj(y) / 1024;
> y2_mag = y2.*conj(y2) / 2056;
>
> What I observed is that when each are plotted seperately, the shape is
> similar but the Y-axis values difffer.
> That is, the y2_mag value (2056-point fft) is smaller than the values
> for the y_mag (1024-point fft).
....
> Is this correct or am I doing something wrong? Thank you so much for
> your help!
There is a scaling constant in the DFT that causes the different
scales you observe.
The forward DFT of a sequence x(n) of length N is defined as
X(k) = sum_(n=0)^(N-1) x(n) exp(-j 2*pi*n*k/N) [1]
and the Inverse DFT is defined as
x(n) = 1/N sum_(k=0)^(N-1) X(k) exp(j 2*pi*n*k/N) [2]
Note that there is no scaling factor in front of [1] and a factor
1/N in front of [2]. This is a matter of convention.
You would have observed the same amplitudes for all
FFT lengts if both the forward transform [1] and the inverse
transform [2] were scaled by 1/sqrt(N).
Rune
Reply by ●April 19, 20062006-04-19
Thank you very much! This has been very helpful!
Reply by krishna_sun82●April 17, 20062006-04-17
>
>plot(y_mag);
>hold on
>plot(y2_mag(1:2:2056,1), 'r')% Plotting the odd numbers
>
>I noticed that the y2_mag (odd values) are still smaller than that of
>the y_mag values.
>
>Is this correct or am I doing something wrong? Thank you so much for
>your help!
>
This is correct. You are not doing anything wrong and nor does MATLAB. You
can get an explanation for why it is correct in any standard book on Maths
or signal processing.
- Krishna
Reply by ●April 15, 20062006-04-15
Thank you for the response!
What do you mean by "Y value"?
For example:
x=data(1:1024);
y = fft(x, 1024);
y2 = fft(x, 2056);
y_mag = y.*conj(y) / 1024;
y2_mag = y2.*conj(y2) / 2056;
What I observed is that when each are plotted seperately, the shape is
similar but the Y-axis values difffer.
That is, the y2_mag value (2056-point fft) is smaller than the values
for the y_mag (1024-point fft).
>Consider a signal in the range [1:1024]. When you compare the 1024-pt FFT
>of this signal with its 2056-point FFT, you can observe that the
>2056-point FFT interpolates the values between two particles of your
>1024-point FFT. That is the (n)th sample of the 1024-FFT output would
>match with the (2n - 1)th sample of the 2056-point FFT, for a one based
>indexing. And every (2n)th component would be the result of
>interpolation.
>Now try plotting the 1024-point FFT output and the odd-numbered (for one
>based indexing)samples of 2056-point FFT. You would see that these two
>match in magnitude and phase.
I tried this and noticed that they match again in shape and phase, but
the absolute magnitudes differ:
>From above,
y_mag = y.*conj(y) / 1024;
y2_mag = y2.*conj(y2) / 2056;
plot(y_mag);
hold on
plot(y2_mag(1:2:2056,1), 'r')% Plotting the odd numbers
I noticed that the y2_mag (odd values) are still smaller than that of
the y_mag values.
Is this correct or am I doing something wrong? Thank you so much for
your help!
Reply by ●April 15, 20062006-04-15
Thank you for the reference. My problem is, I have a very limited
background in math (only take up to introductory calculus), and often
times have problems interpreting the DSP literature. I will take a
loot at Lyons. Thanks again!
Reply by Gian-Carlo Pascutto●April 15, 20062006-04-15
krishna_sun82 wrote:
>>Thank you very much for the response. I did try this, and noticed that
>>the magnitude of the signal is small if you were to use a larger (2056)
>>points. However if only the Y value is plotted the curves would match.
>
>
> What do you mean by "Y value"?
>
>
>>However, when it is plotted on the frequency spectrum the larger has
>>smaller magnitudes...is this normal?
>>
>
>
> I do not think it is normal.
Scaling is a perfectly normal property of FFT's.
For more information, just ask Mr. Google.
--
GCP
Reply by krishna_sun82●April 15, 20062006-04-15
>Thank you very much for the response. I did try this, and noticed that
>the magnitude of the signal is small if you were to use a larger (2056)
>points. However if only the Y value is plotted the curves would match.
What do you mean by "Y value"?
> However, when it is plotted on the frequency spectrum the larger has
>smaller magnitudes...is this normal?
>
I do not think it is normal. Whenever you are trying to plot the frequency
spectra, plot the absolute and the argument seperately. I think the problem
is the way in which you observe the comparison.
Consider a signal in the range [1:1024]. When you compare the 1024-pt FFT
of this signal with its 2056-point FFT, you can observe that the
2056-point FFT interpolates the values between two particles of your
1024-point FFT. That is the (n)th sample of the 1024-FFT output would
match with the (2n - 1)th sample of the 2056-point FFT, for a one based
indexing. And every (2n)th component would be the result of
interpolation.
Now try plotting the 1024-point FFT output and the odd-numbered (for one
based indexing)samples of 2056-point FFT. You would see that these two
match in magnitude and phase.
- Krishna
Reply by Rune Allnor●April 15, 20062006-04-15
jpopovich@gmail.com skrev:
> Thank you very much for the response. I did try this, and noticed that
> the magnitude of the signal is small if you were to use a larger (2056)
> points. However if only the Y value is plotted the curves would match.
> However, when it is plotted on the frequency spectrum the larger has
> smaller magnitudes...is this normal?
These are more or less as expected. Explaining why takes
just a little too much time and effort for USENET, though.
If you are about to use the spectra for any particular purpose,
I would suggest you get an intro text on DSP. One text that
often is suggested here is
Lyons: Understanding Digital Signal Processing, 2nd ed.,
Prentice Hall, 2004.
Understanding the properties of the DFT (the procedure that
take the data as input and produce spectra as output)
is at the core of DSP. It is a subject worth spending time on.
Lyons is very good at explaining these things, he assumes no
prior knowledge of DSP. If and when you have further questions
after reading his book, just ask a question here and you
will get lots of help.
Rune
Reply by ●April 15, 20062006-04-15
Thank you very much for the response. I did try this, and noticed that
the magnitude of the signal is small if you were to use a larger (2056)
points. However if only the Y value is plotted the curves would match.
However, when it is plotted on the frequency spectrum the larger has
smaller magnitudes...is this normal?