LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase frequency resolution in power spectrum?

Solved!
Go to solution

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 11 of 21
(2,711 Views)

Please, provide:

 

1) Data, sampling frequency - missing

2) LabView code                  - ok

3) Matlab code                    - missing (or at least the function call with all parameters)

 

It looks like you are using different parameters for PSD estimation. I guess your matlab code is like this:

 

[PSpectrum,Frequency_interval] = pwelch(X_data,window_size,X_overlap,f,fs)

 

Read the help for "pwelch" in matlab help file; the pwelch uses "hamming" window, however in your code, you use no window.

 

State here, what is the goal of your application. It looks like you measure a lot of data in longer time span. The method you use makes the signal look like noise with some offset. There is probably a better method, that would give you a better insight to the signal behavior.

 

 

 

0 Kudos
Message 12 of 21
(2,708 Views)

Hi,

 

1) Data sampling frequency - 25kHz.

2)Labview code - already sent

3)Matlab code - pwelch(X02_05_12_11_03_23_AM(:,1),2000,1000,2048,25000)

 

I changed to "hamming" window also. Here am sending the new results. This gives also same as like as previous. 

Also I tried detrend of data. Only the X axis is changing, in Y axis there is alwasy a shift in dB.

 

Please help me in this.

 

Thanks & Regards

--Ashokan. M

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
0 Kudos
Message 13 of 21
(2,692 Views)

I ment

 

Data, sampling frequency = Data and sampling frequency, but it is OK 🙂

 

 

So, now you have the same characteristics but different powers all over the spectrum.

 

From the function call in matlab, it looks like you use overlap of 1000, but in labview you use overlap of 50.

 

Before your next post, make sure you understand to all parameters you use and have the same in both codes.

0 Kudos
Message 14 of 21
(2,688 Views)

No yaar,

 

In matlab code : window size = 2000, overlap = 1000,

In Labview code : window size = 2000, overlap = 50 (it means 50%, hence 1000).

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
0 Kudos
Message 15 of 21
(2,679 Views)

Hi Ashokan,

 

It looks like the inputs to the two functions are in line with each other. Have you performed any other experiments with the two functions? As in, have you tried changing the input parameters to both cases (still keeping them the same) to see if this difference in dB level is consistent?

 

Regards, 

James D.
Applications Engineer
National Instruments
0 Kudos
Message 16 of 21
(2,654 Views)

@Ashokan wrote:

No yaar,

 

In matlab code : window size = 2000, overlap = 1000,

In Labview code : window size = 2000, overlap = 50 (it means 50%, hence 1000).


Well, I do not have the TSA Welch function so I am only guessing, at least you can see what happens if someone is too lazy took into the manual 🙂

0 Kudos
Message 17 of 21
(2,647 Views)

Dear Sir

 

 

I am facing almost similar problem.

 

I am using LabVIEW8.2 and USB1208FS for data acquisition. I have successfully configured hardware with LabVIEW and get real time data using universal library VI AInScBg.vi. When I plot my signal on waveform (frequency vs amplitude) then on x-axis frequency is from 0~0.49 hz. I change the sampling rate from 1000hz to 4000hz but on x-axis no change of frequency occours and it is fixed 0.49hz. Can you please guide me how can I get frequency of my own interest (0~500hz) on x-axis.

 

I am attaching LabVIEW fille for  reference.

 

Kind Regards

 

Muhammad Irfan

Student

UTP Malaysia

0060149087570

0 Kudos
Message 18 of 21
(2,646 Views)

You do not have a similar problem at all for this duplicate post.

0 Kudos
Message 19 of 21
(2,642 Views)

Hi James D,

 

I tried the code by changing the input parameters but results some changes in X-axis, as in the case of Y-axis nothing changed.

 

Still there is a shift in some 30dB.

 

Please help me in fixing this.

 

Ashokan. M

Project Scientist - I,

NIOT.

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
0 Kudos
Message 20 of 21
(2,625 Views)