LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase frequency resolution in power spectrum?

Solved!
Go to solution

All,

 

I'm working on an EEG data analysis vi, and am having mucho trouble when it comes to displaying a simple power spectrum that gives an accurate frequency on the sine wave simulation I'm now using.  Most brain waves are between 1-50 Hz, and so I'm trying to get a frequency resolution of at least 1 Hz.  However, no matter what I do (increase sampling rate, use different sub vi's and blocks),  the graph only plots in frequency increments of 10 Hz!  I know this must be a simple problem, but I can't find any good documentation on this, and would appreciate any advice anyone could give on this problem.  I'm racking my brain here!

 

Nick

0 Kudos
Message 1 of 21
(8,232 Views)
Increasing the number of points sampled should do it. See this. Since you said that you've tried it, maybe you should attach your code.
Message 2 of 21
(8,222 Views)
Solution
Accepted by topic author delgrosso.nick

You need to acquire 1 second of data to get 1 Hz resolution.  Increasing the sampling rate only increases the frequency range the FFT covers.

 

 

Frequency resolution = 1/sampling time

 

Frequency span = sampling rate/2

 

 

For your application, you will need to have a sampling rate of a minimum of 100 Hz.  At this rate you will need to acquire 100 samples to get 1 Hz resolution.  At 1 kHz sampling rate, you will need to acquire 1000 points to get 1 Hz resolution.

Message Edited by rpursley8 on 07-10-2009 12:31 PM
Randall Pursley
Message 3 of 21
(8,217 Views)

Hi,

 

I also have the same issue.

 

My data acquisition time is 60 seconds at 25kHz of sampling rate.

Hence the frequency resolution in FFT comes as 1/60 = 0.016468 Hz.

 

But what I need is the frequency resolution should be 100Hz.

 

Can any one help me in this???

 

Thanks & Regards,

--Ashokan. M

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
0 Kudos
Message 4 of 21
(7,731 Views)

Ashokan,

 

why does higher frequency resolution bother you ? Once you gain those frequency bins and you do not need them, you can allways just not use them / calculate mean value / etc.

 

You can decrease the resolution using shorter time frames, for 100 Hz it is 1ms. So you get 100 spectral measurements per second.

 

 

0 Kudos
Message 5 of 21
(7,724 Views)

Dear Bublina,

 

Thanks for the reply.

 

My project is that I have to send these data via ethernet communication. Hence I need lower frequency resolution, which will reduce the size of the file size.

 

I don't have knowledge about shorter time frames!!!

 

Please reply.

 

Thanks & Regards

--Ashokan.

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
0 Kudos
Message 6 of 21
(7,713 Views)

Hi Ashokan,

 

I believe what Bublina means is to use a reduced sampling time interval. As rpursley8 mentioned above, the sampling time is inversely proportional to the frequency resolution. If you use a shorter time interval for sampling then you wil increase the frequency resolution. 

 

1/0.01 s = 100 Hz

 

So use 0.01 seconds for your sampling time. This will give you 250 points with a frequency resolution of 100Hz.

 

I hope this information helps. If you have further questions on using shorter sampling times, please respond to this post.

 

Regards,

James D.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 21
(7,692 Views)

Hi James,

 

Thanks for the reply.

 

I fixed the error.

 

In the case of FFT or PSD or etc., Labview didn't give the same result of MATLAB.

 

There is a lot of differences in the output of FFT between labview and matlab.

 

Could you please help me in this???

 

Thanks & Regards

--Ashokan. M

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
0 Kudos
Message 8 of 21
(7,683 Views)

@Ashokan wrote:

Hi James,

 

Thanks for the reply.

 

I fixed the error.

 

In the case of FFT or PSD or etc., Labview didn't give the same result of MATLAB.

 

There is a lot of differences in the output of FFT between labview and matlab.

 

Could you please help me in this???

 

Thanks & Regards

--Ashokan. M


I do not have checked this, but highly doubt there is any significant difference between FFT done in Matlab and Labview. You are probably using two different sets of parameters if not different data or wrong code.

 

Post here the labview code that you suspect of wrong or different output.

0 Kudos
Message 9 of 21
(7,663 Views)

Sorry for late reply.

 

Here, am sending my labview code and the output of both labview & MATLAB.

 

In the output, there is a shifting in Y axis around 30 dB.

 

Could you please help me in this???

 

Thanks&Regards,

--Ashokan. M

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
Download All
0 Kudos
Message 10 of 21
(7,638 Views)