octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ltfat tria window


From: Peter Søndergaard
Subject: Re: Ltfat tria window
Date: Sat, 03 Jan 2015 09:53:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

Den 03-01-2015 01:25, Jerry skrev:

On Jan 2, 2015, at 1:59 PM, Doug Stewart <address@hidden> wrote:



On Fri, Jan 2, 2015 at 3:54 PM, Jerry <address@hidden> wrote:

On Jan 2, 2015, at 12:29 PM, Doug Stewart <address@hidden> wrote:

> firwin('tria',11,'1')
> ans =
>
>    0.180328
>    0.147541
>    0.114754
>    0.081967
>    0.049180
>    0.016393
>    0.016393
>    0.049180
>    0.081967
>    0.114754
>    0.147541
>
> --
>
>
> This seems to me to be a mistake.
> T was hoping for a triangle window.

It's rotated.
Jerry


Are all the windows in ltfat rotated?
And by being rotated then the unsymmetrical part is at the high part not the zero location at the end?????

So these windows are used quit differently than the ones in signal pkg.
???
Doug

I don't know. I had to Google ltfat to find out what it is. I suppose the argument for using a rotated window is to attenuate high frequencies more than low frequencies (in the case of most windows such as triangular) and use unrotated DFT results as are normally indexed, that is, 0 .. N - 1.. Long ago (before Octave) I wrote a number of my own windows and included both types—windows that are high in the middle and rotated ones that are high at the ends; I called the rotated ones "frequency" windows exactly for this application.

The window example you give, in addition to being rotated, obviously exhibits the error that I brought up with respect to "[bug #43305] Hamming etc. windows are wrong", as you know as I see that you have participated in that discussion. Maybe you need to take up this issue with the authors of ltfat.

Don't get confused by the layout of the LTFAT windows, this is just a different storage convention, the end result when using the window should be the same.

LTFAT has a function called "pfilt" to use the LTFAT windows, this will give you a zero-delay filter from the LTFAT window. The "filter" routines in Octave and Matlab always introduce a time-delay, which can be very confusing sometimes.

I have sensed in the discussion of the referenced bug that there is claimed a legitimate use of the incorrect windows in spectral analysis. I suspect (but don't know for certain) that this is just another use of the incorrect windows and is "justified" by tradition = years of misuse; I anticipated this (some spurious argument) in my original bug report but I will have to see a really, really good explanation of why the use of incorrect windows is correct in spectral analysis.

About the use of windows:There are two different symmetries that you can go for when sampling a continuous window. This will give you sequences likes this:

1
2
1
0

or

.5
1.5
1.5
.5

Both of the above sequences sum to 2 if you shift them 2 samples and add them to themselves, they are both valid candidates for a triangular window of length 4.

For audio applications you would always choose the first one, because it is the symmetry of the DFT. It will give you a linear phase filter if you convolve with the sequence.

For image applications, the second choice has an advantage, because you can deal better with the boundary of the image.

I think going for the first symmetry makes the most sense, because I believe it has the most applications. The boundary handling of image analysis is a much more advanced application than simple audio processing. 

Cheers,
Peter.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]