DSPRelated.com
Forums

Time derivative of Blackman window

Started by adamchapman January 15, 2009
On Jan 15, 3:29 am, adamchapman <adamchapman1...@hotmail.co.uk> wrote:
> Hi, > > I've made a Blcakman window in Matlab with the code: > > windowWidth=256; > Window=(0:windowWidth)/windowWidth; > Window=0.42-0.5*cos(2*pi*adaWindow)+0.08*cos(4*pi*adaWindow); > > This looks fine when I plot it, But Im not sure wether how to > calculate the time derivative of it. An fft of the Window variable > gives just a single peak and a flat line, and > > gradient(Window)*Fs > > doesn't look right either. > > I assume the time derivative looks like this:http://en.wikipedia.org/wiki/File:Window_function_(blackman).png > > Any help is greatly appreciated > > Adam
Adam Take a look at section 5.3.1.3 Computing Window Derivative on page 193 of: http://perso.ens-lyon.fr/patrick.flandrin/0065-Ch05.pdf for an example of an application with code in MATLAB. Dale B. Dalrymple http://dbdimages.com
On Jan 16, 2:09&#4294967295;am, dbd <d...@ieee.org> wrote:
> On Jan 15, 3:29 am, adamchapman <adamchapman1...@hotmail.co.uk> wrote: > > > > > > > Hi, > > > I've made a Blcakman window in Matlab with the code: > > > windowWidth=256; > > Window=(0:windowWidth)/windowWidth; > > Window=0.42-0.5*cos(2*pi*adaWindow)+0.08*cos(4*pi*adaWindow); > > > This looks fine when I plot it, But Im not sure wether how to > > calculate the time derivative of it. An fft of the Window variable > > gives just a single peak and a flat line, and > > > gradient(Window)*Fs > > > doesn't look right either. > > > I assume the time derivative looks like this:http://en.wikipedia.org/wiki/File:Window_function_(blackman).png > > > Any help is greatly appreciated > > > Adam > > Adam > > Take a look at section 5.3.1.3 Computing Window Derivative on page 193 > of: > > http://perso.ens-lyon.fr/patrick.flandrin/0065-Ch05.pdf > > for an example of an application with code in MATLAB. > > Dale B. Dalrymplehttp://dbdimages.com- Hide quoted text - > > - Show quoted text -
Thanks, that pdf is pretty good, but the code does seem a little over complex. All I'm using is: %adaFrame is the frame of the original audio signal being windowed adaWindowSize=993; adaWindow=(1:adaWindowSize)/ adaWindowSize; %n/N adaWindow=0.42-0.5*cos(2*pi*adaWindow)+0.08*cos(4*pi*adaWindow); %Adaptive Blackman Window d_adaWindow=(1:adaWindowSize)/ adaWindowSize; %n/N d_adaWindow=0.5*sin(2*pi*d_adaWindow)-0.08*sin(4*pi*d_adaWindow); %time derivative of Blackman Window S=fft(adaFrame.*adaWindow); %fft of adaptive frame d_S=fft(adaFrame.*d_adaWindow); %fft of time derivative of adaptive frame %resise S and d_S S=S(1:ceil(length(S)/2)); %take only the first half of the spectrum d_S=d_S(1:ceil(length(d_S)/2)); %take only the first half of the spectrum But Looking at the coefficients used in the derivative, I'm unsure if I have the scale of the derivative window correct. Should d_adaWindow be something like d_adaWindow=0.5*(2*pi)*sin(2*pi*d_adaWindow)-0.08*(4*pi)**sin (4*pi*d_adaWindow); ??? I'm unsure of what I am differentiating with Respect to here- am I differentiating w.r.t the term inside the brackets in adaWindow, or just w.r.t n/N in the equation at http://en.wikipedia.org/wiki/Blackman_window#Blackman_windows ?
On Jan 16, 12:24&#4294967295;pm, adamchapman <adamchapman1...@hotmail.co.uk>
wrote:
> On Jan 16, 2:09&#4294967295;am, dbd <d...@ieee.org> wrote: > > > > > > > On Jan 15, 3:29 am, adamchapman <adamchapman1...@hotmail.co.uk> wrote: > > > > Hi, > > > > I've made a Blcakman window in Matlab with the code: > > > > windowWidth=256; > > > Window=(0:windowWidth)/windowWidth; > > > Window=0.42-0.5*cos(2*pi*adaWindow)+0.08*cos(4*pi*adaWindow); > > > > This looks fine when I plot it, But Im not sure wether how to > > > calculate the time derivative of it. An fft of the Window variable > > > gives just a single peak and a flat line, and > > > > gradient(Window)*Fs > > > > doesn't look right either. > > > > I assume the time derivative looks like this:http://en.wikipedia.org/wiki/File:Window_function_(blackman).png > > > > Any help is greatly appreciated > > > > Adam > > > Adam > > > Take a look at section 5.3.1.3 Computing Window Derivative on page 193 > > of: > > >http://perso.ens-lyon.fr/patrick.flandrin/0065-Ch05.pdf > > > for an example of an application with code in MATLAB. > > > Dale B. Dalrymplehttp://dbdimages.com-Hide quoted text - > > > - Show quoted text - > > Thanks, that pdf is pretty good, but the code does seem a little over > complex. All I'm using is: > > %adaFrame is the frame of the original audio signal being windowed > adaWindowSize=993; > > adaWindow=(1:adaWindowSize)/ > adaWindowSize; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; %n/N > adaWindow=0.42-0.5*cos(2*pi*adaWindow)+0.08*cos(4*pi*adaWindow); > %Adaptive Blackman Window > > d_adaWindow=(1:adaWindowSize)/ > adaWindowSize; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;%n/N > d_adaWindow=0.5*sin(2*pi*d_adaWindow)-0.08*sin(4*pi*d_adaWindow); > %time derivative of Blackman Window > > S=fft(adaFrame.*adaWindow); &#4294967295; &#4294967295; %fft of adaptive frame > d_S=fft(adaFrame.*d_adaWindow); %fft of time derivative of adaptive > frame > > %resise S and d_S > S=S(1:ceil(length(S)/2)); &#4294967295; &#4294967295; &#4294967295; %take only the first half of the > spectrum > d_S=d_S(1:ceil(length(d_S)/2)); %take only the first half of the > spectrum > > But Looking at the coefficients used in the derivative, I'm unsure if > I have the scale of the derivative window correct. Should d_adaWindow > be something like > > d_adaWindow=0.5*(2*pi)*sin(2*pi*d_adaWindow)-0.08*(4*pi)**sin > (4*pi*d_adaWindow); > > ??? > > I'm unsure of what I am differentiating with Respect to here- am I > differentiating w.r.t the term inside the brackets in adaWindow, or > just w.r.t n/N in the equation athttp://en.wikipedia.org/wiki/Blackman_window#Blackman_windows > ?- Hide quoted text - > > - Show quoted text -
my sample rate is Fs=16000 Hz if that is relevant, which I think it should be
On Jan 16, 4:24 am, adamchapman <adamchapman1...@hotmail.co.uk> wrote:
> On Jan 16, 2:09 am, dbd <d...@ieee.org> wrote: > > > > > On Jan 15, 3:29 am, adamchapman <adamchapman1...@hotmail.co.uk> wrote: > > > > Hi, > > > > I've made a Blcakman window in Matlab with the code: > > > > windowWidth=256; > > > Window=(0:windowWidth)/windowWidth; > > > Window=0.42-0.5*cos(2*pi*adaWindow)+0.08*cos(4*pi*adaWindow); > > > > This looks fine when I plot it, But Im not sure wether how to > > > calculate the time derivative of it. An fft of the Window variable > > > gives just a single peak and a flat line, and > > > > gradient(Window)*Fs > > > > doesn't look right either. > > > > I assume the time derivative looks like this:http://en.wikipedia.org/wiki/File:Window_function_(blackman).png > > > > Any help is greatly appreciated > > > > Adam > > > Adam > > > Take a look at section 5.3.1.3 Computing Window Derivative on page 193 > > of: > > >http://perso.ens-lyon.fr/patrick.flandrin/0065-Ch05.pdf > > > for an example of an application with code in MATLAB. > > > Dale B. Dalrymplehttp://dbdimages.com-Hide quoted text - > > > - Show quoted text - > > Thanks, that pdf is pretty good,
.>but the code does seem a little over complex. That is a common view of code, written by programmers who are capable of commenting their code with the assumptions they have made, when interpreted by people who aren't capable of commenting their code with the assumptions they have made.
> All I'm using is: > ...
> > I'm unsure of what I am differentiating with Respect to here- am I > differentiating w.r.t the term inside the brackets in adaWindow, or > just w.r.t n/N in the equation athttp://en.wikipedia.org/wiki/Blackman_window#Blackman_windows > ?
You are supposed to be differentiating with respect to time. Perhaps you would do better to write the analytic form, apply the analytic operation (the derivative) and then converting to an implementation. If you do this the argument of the first order trig term in the definition of the window should be of a form like 2*pi*fs*t/N so that you can explicitly see the t variable and apply the analytic operation correctly. Implementing the window calculation and attempting to apply an analytic operation isn't working for you. However, the code I suggested to you does perform a discrete derivative operation on an implemented window, if that is what you really want. In fact, the topic of the reference I gave includes the calculation of instantaneous frequency by DFT methods. Dale B. Dalrymple