Hi,

Here is a patch to fix the Blackman-Harris window generator.

It turns out that the version in current svn generates asymmetrical windows for an even number of points.

This patch fixes that.

I intend to take a look at the other windows but that might be a few days out.

Mike
Index: main/signal/inst/blackmanharris.m
===================================================================
--- main/signal/inst/blackmanharris.m   (revision 5506)
+++ main/signal/inst/blackmanharris.m   (working copy)
@@ -30,7 +30,7 @@
        a1 = 0.48829;
        a2 = 0.14128;
        a3 = 0.01168;
-       n = -ceil(N/2):N/2;
-       w = a0 + a1.*cos(2.*pi.*n./N) + a2.*cos(4.*pi.*n./N) + 
a3.*cos(6.*pi.*n./N);
+       n = 0:N;
+       w = a0 - a1.*cos(2.*pi.*n./N) + a2.*cos(4.*pi.*n./N) - 
a3.*cos(6.*pi.*n./N);
 endfunction;
        
\ No newline at end of file
------------------------------------------------------------------------------
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to