LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

STFT Spectrogram - 50% Overlap

Solved!
Go to solution

Hello...

 

I compared array values.

I was comparing: values of matlab after conjugate, with values of labview without conjugation. But now I removed the conjugation of the matlab macro and I am comparing right after specgram function, and the results are still different.

 

What I made:

 

- loaded data in matlab (load_in_matlab.txt) and run the macro;

- double clicked on the matrix created by matlab with the specgram (Sig1_results) results;

- into number format I selected longG and verified the values;

- to avoid differences in the interpolation, I saved the interpolated series generated by the macro of matlab (Sig1_interpolated);

- this interpolated series was loaded into labview code (load_in_labview.txt).

 

Attached is:

 

- data to be loaded into matlab;

- data to be loaded into labview;

- matlab routine;

- labview routine.

 

The matlab commands are:

 

load load_in_matlab.txt

[Sig1_results, Sig2_results, Sig1_interpolated, Sig2_interpolated, x]=macro(load_in_matlab);

save load_in_labview.txt Sig1_interpolated -ascii

clear

exit

 

I am getting crazy with this problem. Thanks for any advice and help.

 

Dan07

 

0 Kudos
Message 31 of 36
(3,318 Views)

Hello...

 

Sorry for too many questions, I promise that this is the last one :smileyhappy:

 

This code of matlab :

[B,F,T]=specgram(pi,512,10,hanning(512),256);
B=B.*conj(B);

 

Does the Labview routine represented in the image attached perform the same of the Matlab code?

 

Thanks

 

Dan07


Message Edited by dan07 on 02-06-2009 05:30 PM
0 Kudos
Message 32 of 36
(3,289 Views)

Hello Dan,

 

Sorry i have no time to spend on your project at the moment

 but to answer your question yes it's the same 

 

try to make test signals to compare the two code ex pure sinus and composed knowed signals 

 To make tests between matlab and labview code, have a look on programmation->structure->mathscript node

this mayb be allow you to reuse parts of your matlab code like specgram function

 

@+

Tinnitus

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 33 of 36
(3,219 Views)

hello,

 

sorry i read too fast i thought you were only talking about z* 

 but to the rest of the post is still available, 

 1) have a look on mathscript  2) make test with kowned signals

 

@+

tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 34 of 36
(3,206 Views)

Hello,

 

I have a problem with STFT. A labview program is attached. I want to vary the window size (say to change the time and frequency resolution, where can I do it in the program? If you intend to modify my program, pls down grade to 7.1. Thanks.

 

Wallace

0 Kudos
Message 35 of 36
(2,781 Views)

Hello!

 

I want to speak more explicitly what my problem is. Actually my problem is how to control the size of the short time window (say, from 2, 4, 8, 16 points) running accross the whole signal step by step, and how many points (after zero pedding) are used to generate the FFT plots.

 

The LabVIEW tutorial says for time interval in STFT spectrogram says '....specifies the time interval to observe the input signal in the joint time-frequency domain. The value of time interval must be greater than zero. The default value is -1 and specifies that this VI adjusts the time interval automatically so that the joint time-frequency representation has no more than 512 time bins. time interval is in the normalized unit, number of samples. The number of time points in the joint time-frequency representation equals floor((signal length – 1)/time interval) + 1'

 

When I used the default values -1 in both time interval and no. of freq bins in the STFT vi, it looks to me that the short time window should be 512 (confirmed after a backward calcaution, i.e. reciprocal of freq resolution x time resolution), but it seems to be that 512 is too big for a short time window. So is zero padding used? If so, what is the number of time bins before zero padding?

 

It looks amazing to me because simply two magic default numbers -1 solve the most fundamental problem in STFT, i.e. A wide window gives better frequency resolution but poor time resolution; and a narrower window gives good time resolution but poor frequency resolution. However, this fundamental statement is true when I vary the number of frequency bin and time interval connecting the STFT vi to other values (say, any +ve integer other than -1). So what's behind the -1? I am confused here. Am I wrong in any point?

 

Thanks.

 

Wallace

0 Kudos
Message 36 of 36
(2,756 Views)