LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Power spectrum density at 0.25 Hz resolution

Solved!
Go to solution

Hi,

My issue is similar to this thread. I am trying to get frequency resolution of 0.25 Hz while performing continuous PSD.

I have tried circular buffer, but it doesn't solve my problem.

There are 2 issues,

(i) results not matching with expected output

(ii) -Inf values in PSD, when input signal frequency is in integer multiple.

Pls note, I am using PSD block from Sound & Vibration library.

I have attached simplified version of code (LV12) and snippets herewith.

 

Please let me know, if any more details are required.

Thanks,

Nikunj

 

0 Kudos
Message 1 of 32
(3,878 Views)

Why are you enqueue-ing an array?

 

Enqueue elements instead. Then in the dequeuer, either wait for an element, or check if it times out.

 

Not that that will help your problem, but when there's a bug simplification is usually a good idea.

 

The first two iterations, those PSD VIs are called with uninitialized data. That might screw them up, and the result is put in the shift register. So it might never get better...

0 Kudos
Message 2 of 32
(3,853 Views)

If you have a piece of code that gives you the "expected" .25 Hz resolution, why aren't you using that?

 

Do you see the differences in the block diagram between the "actual" and the "expected"?

 

In order to get 1/4 Hz resolution on a spectrum, you need to collect 4 seconds worth of data before you analyze it.

0 Kudos
Message 3 of 32
(3,845 Views)

wiebe@CARYA wrote:

Why are you enqueue-ing an array?

 

Enqueue elements instead. Then in the dequeuer, either wait for an element, or check if it times out.

 

Not that that will help your problem, but when there's a bug simplification is usually a good idea.

 

The first two iterations, those PSD VIs are called with uninitialized data. That might screw them up, and the result is put in the shift register. So it might never get better...



Thanks for a quick reply.

 

I do understand your point. 

1) In my actual application, I am acquiring signals of multiple channels, hence i kept architecture same, i.e. enqueue-ing array of waveform. Also, I have used same architecture for 'testExpected.vi', which is giving proper output.

2) I initialized all 3 shift registers with waveform of 1000 points and 0 value, still output goes to -ve infinity @ 11hz.

 

 

0 Kudos
Message 4 of 32
(3,841 Views)

@RavensFan wrote:

If you have a piece of code that gives you the "expected" .25 Hz resolution, why aren't you using that?

 

Do you see the differences in the block diagram between the "actual" and the "expected"?

 

In order to get 1/4 Hz resolution on a spectrum, you need to collect 4 seconds worth of data before you analyze it.


 

Sorry, I don't understand your point.

As i understand, DeltaF = Fs/ N.

Hence, using shift register I accumulated data of previous 3 seconds and concatenated with current data, to get total 4 second data.

 

NOTE:

1) Though I mentioned incorrect time domain waveform, but now i understood, it's not a problem. It's going to be like that only.

2) Attached output from trialExpected @ 11hz.

0 Kudos
Message 5 of 32
(3,835 Views)