10-30-2009 09:03 AM
I want to use the pwelch function to determine PSD. Here is the snippet of code
fs = 1000;
t = 0:1/fs:0.9;
fftsize = 1024;
noise = randn(size(t));
x=exp(1j*2*pi*t*200);
w=(randn(size(t)) + 1j*randn(size(t)))/sqrt(2);
s = x+w;
win = hamming(64);
noverlap = 32;
[Pxx,f] = pwelch(s,win, noverlap, fftsize, fs, 'twosided');
This works perfectly fine in Matlab, but crashes in Labview. I've traced the problem to the fact that my input signal is complex. If I make it real-valued, it runs fine. When I use complex numbers I get the following error
Error -90046 occurred at Error in function pwelch at line 26. The input parameters are not in the required format.
Again, this code works find in Matlab, so if anyone has any insight I would appreciate the help.
Bill
10-30-2009 09:46 AM
10-30-2009 12:30 PM
After talking with NI, we discovered that the pwelch function only accepts real data, not complex. Hopefully, they will fix this in a future version.