DSPRelated.com
Forums

Why use such a window?

Started by HyeeWang March 26, 2009
I am studying a matlab function specsub.m,which perfom  Martin's
spectral subtrction method.
specsub.m can be found in the lately voicebox.

A new window usage attractted me and made me puzzle.

what is charecteristic of the follwing window? Why use such a window?

  w=sqrt(hamming(nf+1))'; w(end)=[]; % for now always use sqrt hamming
window
  w=w/sqrt(sum(w(1:ni:nf).^2));       % normalize to give overall gain
of 1

  hint: nf = 256 represent frame length, and ni = 128 is the frame
shift.

And,  when reconstructing time data,it multiply w again.
  se=(irfft((yf.*g).',nf).').*repmat(w,nr,1);   % inverse dft and
apply output window

But especially ,I am confused that ,when reconstrcting time data from
frequency domain,it multiply the vector computed from ifft by the
given window,not divide. At the same time ,it also use overlap add to
reconstruct data.

why use such a window? It is the first time that I see multiplying
window after ifft computation,altough I saw a lot dividing winodw
after ifft computation before.

Any comments would be appreciated.

Regards
HyeeWang
On Mar 25, 8:05 pm, HyeeWang <hyeew...@gmail.com> wrote:
> I am studying a matlab function specsub.m,which perfom Martin's > spectral subtrction method. > specsub.m can be found in the lately voicebox. > > A new window usage attractted me and made me puzzle. > > what is charecteristic of the follwing window? Why use such a window? > > w=sqrt(hamming(nf+1))'; w(end)=[]; % for now always use sqrt hamming > window > w=w/sqrt(sum(w(1:ni:nf).^2)); % normalize to give overall gain > of 1 > > hint: nf = 256 represent frame length, and ni = 128 is the frame > shift. > > And, when reconstructing time data,it multiply w again. > se=(irfft((yf.*g).',nf).').*repmat(w,nr,1); % inverse dft and > apply output window > > But especially ,I am confused that ,when reconstrcting time data from > frequency domain,it multiply the vector computed from ifft by the > given window,not divide. At the same time ,it also use overlap add to > reconstruct data. > > why use such a window? It is the first time that I see multiplying > window after ifft computation,altough I saw a lot dividing winodw > after ifft computation before. > > Any comments would be appreciated. > > Regards > HyeeWang
The window is applied to minimize cross-term effects in time varying applications of the WOSA analysis-synthesis architecture. See an illustration: http://www.dsprelated.com/dspbooks/sasp/Example_Polyphase_Analysis_Weighted.html The choice of Hamming window seems to be the habitual following of a recommendation by McAuley and Quatieri in the early days of DFT analysis-synthesis applied to time varying systems. Dale B. Dalrymple
On Mar 26, 12:24&#4294967295;pm, dbd <d...@ieee.org> wrote:
> On Mar 25, 8:05 pm, HyeeWang <hyeew...@gmail.com> wrote: > > > > > > > I am studying a matlab function specsub.m,which perfom &#4294967295;Martin's > > spectral subtrction method. > > specsub.m can be found in the lately voicebox. > > > A new window usage attractted me and made me puzzle. > > > what is charecteristic of the follwing window? Why use such a window? > > > &#4294967295; w=sqrt(hamming(nf+1))'; w(end)=[]; % for now always use sqrt hamming > > window > > &#4294967295; w=w/sqrt(sum(w(1:ni:nf).^2)); &#4294967295; &#4294967295; &#4294967295; % normalize to give overall gain > > of 1 > > > &#4294967295; hint: nf = 256 represent frame length, and ni = 128 is the frame > > shift. > > > And, &#4294967295;when reconstructing time data,it multiply w again. > > &#4294967295; se=(irfft((yf.*g).',nf).').*repmat(w,nr,1); &#4294967295; % inverse dft and > > apply output window > > > But especially ,I am confused that ,when reconstrcting time data from > > frequency domain,it multiply the vector computed from ifft by the > > given window,not divide. At the same time ,it also use overlap add to > > reconstruct data. > > > why use such a window? It is the first time that I see multiplying > > window after ifft computation,altough I saw a lot dividing winodw > > after ifft computation before. > > > Any comments would be appreciated. > > > Regards > > HyeeWang > > The window is applied to minimize cross-term effects in time varying > applications of the WOSA analysis-synthesis architecture. > See an illustration:http://www.dsprelated.com/dspbooks/sasp/Example_Polyphase_Analysis_We... > > The choice of Hamming window seems to be the habitual following of a > recommendation by McAuley and Quatieri in the early days of DFT > analysis-synthesis applied to time varying systems. > > Dale B. Dalrymple- Hide quoted text - > > - Show quoted text -
Thank you. Dale . What you attached is very helpful for me, and I will learn it in detail soon.
dbd wrote:
> On Mar 25, 8:05 pm, HyeeWang <hyeew...@gmail.com> wrote:
>> what is charecteristic of the follwing window? Why use such a >> window? >> >> w=sqrt(hamming(nf+1))'; w(end)=[]; >> % for now always use sqrt hamming window
> The window is applied to minimize cross-term effects in time > varying applications of the WOSA analysis-synthesis > architecture. See an illustration: > http://www.dsprelated.com/dspbooks/sasp/Example_Polyphase_Analysi > s_Weighted.html
Also this page from the same work: http://www.dsprelated.com/dspbooks/sasp/Choice_WOLA_Window.html Martin -- If people knew how hard I worked to get my mastery, it wouldn't seem so wonderful at all. --Michelangelo Buonarroti
On 26 Mrz., 04:05, HyeeWang <hyeew...@gmail.com> wrote:
> [...] Why use such a window? > > &#4294967295; w=sqrt(hamming(nf+1))';
Are you sure "hamming" is the right choice here? Also, a nice alternative to sqrt(x) is IMHO sin(x*pi/2): w = sin((0.5:n).*pi/n).^2; % "raised cosine" w = sin(pi/2.*w); (This is used for the MDCT in Ogg Vorbis) Cheers! SG