05-09-2012 06:51 AM
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
05-09-2012 07:29 AM - edited 05-09-2012 07:30 AM
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.
05-10-2012 03:53 AM
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
05-10-2012 04:29 AM
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.
05-10-2012 08:13 AM
No yaar,
In matlab code : window size = 2000, overlap = 1000,
In Labview code : window size = 2000, overlap = 50 (it means 50%, hence 1000).
05-11-2012 03:56 PM
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,
05-12-2012 04:08 AM
@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 🙂
05-12-2012 04:53 AM
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
05-12-2012 12:35 PM
You do not have a similar problem at all for this duplicate post.
05-15-2012 09:31 AM
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.