LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between the Matlab and LabVIEW Hann (Hanning) functions

Hi All,

 

I'm hoping someone out there can satisfy my curiosity. I have been porting over some code from Matlab to LabVIEW and came accross a difference in the two implementations of the Hann function. Essentially:

 

LabVIEW has array length = n

http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/hanning_window/

 

Matlab has array length -1 = N.

http://www.mathworks.co.uk/help/signal/ref/hann.html

 

(where n= N in the two implementations)

 

As I'm not very clued up on signal processing I was hoping someone could explain why there is a difference in implementation and why array length was chosen for the LabVIEW implementation. According to wolfram the parameter a is full width at half maximum:

 

http://mathworld.wolfram.com/HanningFunction.html

http://mathworld.wolfram.com/FullWidthatHalfMaximum.html

 

Is the difference just due to the interpretation of what this value should be?

 

I've attached a modified version of the window comparison example to illustrate the diference.

 

Thanks,

0 Kudos
Message 1 of 3
(3,018 Views)

@^N wrote:

LabVIEW has array length = n

Matlab has array length -1 = N.


Could part o the confusion be due to the fact that LabVIEW arrays start with index zero and matlab arrays start with index one?

 

I'll look at your code later...

0 Kudos
Message 2 of 3
(3,012 Views)

It did cross my mind but I validated the LabVIEW code for the Matlab Hann, alsoo it states in the Matlab documentation the window is over 0<= n 0<= N, so I don't think it's an indexing difference unless I'm missing something

0 Kudos
Message 3 of 3
(3,005 Views)