FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-08-2003, 02:18 PM
Saumyajit
Guest
 
Posts: n/a
Default PSD Calculation

HI All,
I am an engg student doing a project on FFT. Now I am in the process
of learning DSP.I am stuck with a problem related to the calculation
of PSD. Could anybody please help me out ??
I have got a 16 point FFT Processor.Now after FFT Processiing I do
have 16 complex o/ps which are in the frequency domain.I have to
calculate the PSD over these points. How do i do that ? I should not
use MATLAB for this. I have to write the code in VHDL.
I downloaded some material which says that After FFT processing I have
to calculate the Power which is the square of the samples, then divide
it by the sampling freuency.
Some other documents says that If I take the squre of the o/p samples,
I will get the PSD. So I am confused over this.

Thanks in advance.

Saumya
Reply With Quote
  #2 (permalink)  
Old 12-08-2003, 09:13 PM
Rune Allnor
Guest
 
Posts: n/a
Default Re: PSD Calculation

[email protected] (Saumyajit) wrote in message news:<[email protected] com>...
> HI All,
> I am an engg student doing a project on FFT. Now I am in the process
> of learning DSP.I am stuck with a problem related to the calculation
> of PSD. Could anybody please help me out ??
> I have got a 16 point FFT Processor.Now after FFT Processiing I do
> have 16 complex o/ps which are in the frequency domain.I have to
> calculate the PSD over these points. How do i do that ? I should not
> use MATLAB for this. I have to write the code in VHDL.
> I downloaded some material which says that After FFT processing I have
> to calculate the Power which is the square of the samples, then divide
> it by the sampling freuency.
> Some other documents says that If I take the squre of the o/p samples,
> I will get the PSD. So I am confused over this.


First, you have to find the documentation of your FFT routine. Formally,
the Discrete Fourier Transform (DFT) is defined as something like

1 N-1 2pi nk
X(k) = ------- sum x(n) exp(-j-------- )
sqrt(N) n=0 N

and the Inverse DFT as

1 N-1 2pi nk
x(n) = ------- sum X(k) exp( j-------- ).
sqrt(N) k=0 N

Note the 1/sqrt(N) factor that pops out in both formulas.

The FFT/IFFT routines usually "simplify" the transforms by dividing
by N in either the forward or inverse transform. Matlab does, for
instance, not scale the sum at all in the forward transform but
divides by N in the inverse transform.

You have to make sure that you skale the DFT with 1/sqrt(N).

As for scaling with the frequency, we usually want the PSD estimate
in terms of physichal, not normalized, frequency. So when you have
an N-point DFT, it spans a physical bandwidth of Fs Hz (Fs is sampling
frequency) and its frequency bins are dF= Fs/N wide.

You want a power spectral *density* estimate that relates to the
physical world, so you want to know how much power each frequency
bin represents. Remember, power spectral density relates to how
much power is found inside a given bandwidt, so you need to multiply
the coefficient in each bin with the bandwidth of the bin, dF.

These scaling factors are often skipped (or treated very sloppy)
since people often are content with finding an estimate for the
shape of the spectrum, and do not necessarily care too much about
the numbers.

Rune
Reply With Quote
  #3 (permalink)  
Old 12-13-2003, 09:38 PM
Tom
Guest
 
Posts: n/a
Default Re: PSD Calculation



Saumyajit wrote:

> HI All,
> I am an engg student doing a project on FFT. Now I am in the process
> of learning DSP.I am stuck with a problem related to the calculation
> of PSD. Could anybody please help me out ??
> I have got a 16 point FFT Processor.Now after FFT Processiing I do
> have 16 complex o/ps which are in the frequency domain.I have to
> calculate the PSD over these points. How do i do that ? I should not
> use MATLAB for this. I have to write the code in VHDL.
> I downloaded some material which says that After FFT processing I have
> to calculate the Power which is the square of the samples, then divide
> it by the sampling freuency.
> Some other documents says that If I take the squre of the o/p samples,
> I will get the PSD. So I am confused over this.
>
> Thanks in advance.
>
> Saumya


You need the nearest approximation which is called the periodogram - found
as follows.

Suppose X(k) are the FFT frequency samples found in the usual way (with no
division by N or sqrt(N) by the way).
Then the periodogram is mag(X(k))^2/N
where mag is the sqrt(real^2+imag^2) ie the usual modulus of a complex
number. Here we square it and divide by N, the number of FFT points. There
is another way you can do it if you know X(k). You can do this

P(i)=P(i-1)*beta+(1-beta)*X(k)*X'(k)

where X'(k) is the complex conjugate of X(k) at FFT frame i and beta is a
forgetting factor 0<beta<1 the choice of which needs a little
experimenting with. P(i) is the periodogram at FFT frame i. The forgetting
fact beta should be close to unity for good smoothing and perhaps nearer
to 0.6? if you need good tracking ie the data is highly non-stationary
like speech. If it is staionary data then a beta close to unity will make
the periodogram 'converge' to the PSD.

Tom


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
doubt in power calculation chaitu VHDL 1 04-03-2007 09:14 PM
DNL and INL calculation AL FPGA 10 02-21-2005 08:17 AM
CRC polynomal calculation Runar Gjelsvik VHDL 2 04-29-2004 11:08 AM
Power calculation using Xpower praveen FPGA 5 12-02-2003 11:32 AM


All times are GMT +1. The time now is 01:01 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved