DSPRelated.com
Forums

Shifting FIR frequency centre

Started by kaz April 13, 2012
You design a linear FIR(symmetrical real coefficients) then you decide to
move its frequency centre. The new FIR (complex) may not maintain symmetry
of its real part or imaginary part or both. Its groupdelay may show
"spikes"
around that of original FIR.

Does that mean we lost linearity by shifting? 

Any response appreciated.

Kadhiem
On Apr 13, 3:26&#4294967295;am, "kaz" <kadhiem_ayob@n_o_s_p_a_m.yahoo.co.uk>
wrote:
> You design a linear FIR(symmetrical real coefficients) then you decide to > move its frequency centre. The new FIR (complex) may not maintain symmetry > of its real part or imaginary part or both. Its groupdelay may show > "spikes" > around that of original FIR. > > Does that mean we lost linearity by shifting? > > Any response appreciated. > > Kadhiem
How did you shift the coefficients? If you do so at the design stage you probably have to adjust the number of taps in order to achieve a shifted frequency response... ...homework? :-). .Joerg
On Friday, April 13, 2012 4:26:25 AM UTC-4, kaz wrote:
> You design a linear FIR(symmetrical real coefficients) then you decide to > move its frequency centre. The new FIR (complex) may not maintain symmetry > of its real part or imaginary part or both. Its groupdelay may show > "spikes" > around that of original FIR. > > Does that mean we lost linearity by shifting? > > Any response appreciated. > > Kadhiem
I think you have answered your own question. For linear phase FIR filters, the phase response may be written as phi(F) = A+B*2*pi*F where A is 0 or pi/2. And B is -(N-1)/2 where N is the number of taps in the filter. So group delay = -d phi / d F = (N-1)/2 which is constant. So if your group delay is non constant, then you can't have linear phase. IHTH, Clay
>On Apr 13, 3:26=A0am, "kaz" <kadhiem_ayob@n_o_s_p_a_m.yahoo.co.uk> >wrote: >> You design a linear FIR(symmetrical real coefficients) then you decide
to
>> move its frequency centre. The new FIR (complex) may not maintain
symmetr=
>y >> of its real part or imaginary part or both. Its groupdelay may show >> "spikes" >> around that of original FIR. >> >> Does that mean we lost linearity by shifting? >> >> Any response appreciated. >> >> Kadhiem > >How did you shift the coefficients? If you do so at the design stage >you probably have to adjust the number of taps in order to achieve a >shifted frequency response... > >...homework? :-). > >.Joerg >
For God's sake What has your reply got to do with the question??? or are you just a spammer? Kadhiem
On Fri, 13 Apr 2012 03:26:25 -0500, kaz wrote:

> You design a linear FIR(symmetrical real coefficients) then you decide > to move its frequency centre. The new FIR (complex) may not maintain > symmetry of its real part or imaginary part or both. Its groupdelay may > show "spikes" > around that of original FIR. > > Does that mean we lost linearity by shifting?
Linearity, or linear phase? Review the definition of linearity, and your question answers itself. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
On 4/13/12 4:26 AM, kaz wrote:
> You design a linear FIR(symmetrical real coefficients) then you decide to > move its frequency centre.
how are you doing that? by redesigning it (with all design parameters except one that are unchanged)? if you had an FIR, h[n], and you wanted to simply adjust the coefficients to bump up or down the whole frequency response, you can do something with the Hilbert transform and analytic signal (the same thing we do to make a "frequency shifter"), but there are all sorts of other things that happen in the chain, and it doesn't preserve phase linearity.
> The new FIR (complex) may not maintain symmetry > of its real part or imaginary part or both. Its groupdelay may show > "spikes" > around that of original FIR. > > Does that mean we lost linearity by shifting?
depends on how you do the shifting. you can redesign the FIR with phase-linear constraints and the frequency-domain specification shifted. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Fri, 13 Apr 2012 11:56:40 -0400, robert bristow-johnson wrote:

> On 4/13/12 4:26 AM, kaz wrote: >> You design a linear FIR(symmetrical real coefficients) then you decide >> to move its frequency centre. > > how are you doing that? by redesigning it (with all design parameters > except one that are unchanged)? > > if you had an FIR, h[n], and you wanted to simply adjust the > coefficients to bump up or down the whole frequency response, you can do > something with the Hilbert transform and analytic signal (the same thing > we do to make a "frequency shifter"), but there are all sorts of other > things that happen in the chain, and it doesn't preserve phase > linearity.
I'm not sure what you're thinking, but you can easily shift a lowpass FIR's response in frequency by multiplying it by a sinusoid. If you keep it real and multiply, then the result responds to both positive and negative frequencies; if you allow it to be complex and multiply by an inphase and quadrature component, then it'll just respond to one frequency. No Hilbert transforms necessary -- at least in the FIR. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
On 4/13/12 1:11 PM, Tim Wescott wrote:
> On Fri, 13 Apr 2012 11:56:40 -0400, robert bristow-johnson wrote: > >> On 4/13/12 4:26 AM, kaz wrote: >>> You design a linear FIR(symmetrical real coefficients) then you decide >>> to move its frequency centre. >> >> how are you doing that? by redesigning it (with all design parameters >> except one that are unchanged)? >> >> if you had an FIR, h[n], and you wanted to simply adjust the >> coefficients to bump up or down the whole frequency response, you can do >> something with the Hilbert transform and analytic signal (the same thing >> we do to make a "frequency shifter"), but there are all sorts of other >> things that happen in the chain, and it doesn't preserve phase >> linearity. > > I'm not sure what you're thinking, but you can easily shift a lowpass > FIR's response in frequency by multiplying it by a sinusoid. If you keep > it real and multiply, then the result responds to both positive and > negative frequencies; if you allow it to be complex and multiply by an > inphase and quadrature component, then it'll just respond to one > frequency. >
it's close to what i am thinking. but, to keep it real, how are you gonna just shift it up or just shift it down? multiplying by cos(wt) shifts it in both directions (and adds the two). we *are* gonna be multiplying by e^(jwt) (where w or "omega" can be positive to upshift or negative to downshift). but to turn this into a realizable filter with real coefficients, how're you gonna do that without the analytic signal (and how're you gonna get one of them without help from Hilbert)? even though i hate using pseudo-LaTeX math on USENET (i prefer my own flavor of ASCII math), i'm gonna do that now: h[n] is the FIR you're starting with. \hat{h}[n] is the Hilbert transform of h[n] (or some FIR approximation of it, like how MATLAB does it) h_a[n] = h[n] + j \hat{h}[n] the analytic signal of h[n] you can do that without Hilbert if you DFT it, zero the latter half (or negative frequencies) while doubling the firster half (the positive frequencies). that's the MATLAB way. e^{j \omega n} h_a[n] is the frequency shifted h_a[n] g[n] = \Re \{ e^{j \omega n} h_a[n] \} = h[n] \cos(\omega n) + \hat{h}[n] \sin(\omega n) that's what i meant, Tim. now h[n] has even symmetry (about the center sample) and \hat{h}[n] has odd symmetry (about the center sample), so both are, in their own way, phase linear. and they remain so (in the same even/odd sense) when you multiply by cos() or sin() (assume that both cos() and sin() are delayed to be even and odd around the center sample). but when you add an even symmetry to an odd symmetry function, you don't get either symmetry (unless one is zero everywhere). -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On 4/13/12 1:49 PM, robert bristow-johnson wrote:
> g[n] = \Re \{ e^{j \omega n} h_a[n] \} > > = h[n] \cos(\omega n) + \hat{h}[n] \sin(\omega n)
i think i messed up a sign. g[n] = h[n] \cos(\omega n) - \hat{h}[n] \sin(\omega n) -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Fri, 13 Apr 2012 13:49:01 -0400, robert bristow-johnson
<rbj@audioimagination.com> wrote:

>On 4/13/12 1:11 PM, Tim Wescott wrote: >> On Fri, 13 Apr 2012 11:56:40 -0400, robert bristow-johnson wrote: >> >>> On 4/13/12 4:26 AM, kaz wrote: >>>> You design a linear FIR(symmetrical real coefficients) then you decide >>>> to move its frequency centre. >>> >>> how are you doing that? by redesigning it (with all design parameters >>> except one that are unchanged)? >>> >>> if you had an FIR, h[n], and you wanted to simply adjust the >>> coefficients to bump up or down the whole frequency response, you can do >>> something with the Hilbert transform and analytic signal (the same thing >>> we do to make a "frequency shifter"), but there are all sorts of other >>> things that happen in the chain, and it doesn't preserve phase >>> linearity. >> >> I'm not sure what you're thinking, but you can easily shift a lowpass >> FIR's response in frequency by multiplying it by a sinusoid. If you keep >> it real and multiply, then the result responds to both positive and >> negative frequencies; if you allow it to be complex and multiply by an >> inphase and quadrature component, then it'll just respond to one >> frequency. >> > >it's close to what i am thinking. but, to keep it real, how are you >gonna just shift it up or just shift it down? multiplying by cos(wt) >shifts it in both directions (and adds the two). > >we *are* gonna be multiplying by e^(jwt) (where w or "omega" can be >positive to upshift or negative to downshift). but to turn this into a >realizable filter with real coefficients, how're you gonna do that >without the analytic signal (and how're you gonna get one of them >without help from Hilbert)?
Tim described this already. If you let the filter coefficients be complex (and the OP mentioned this as well), then it already has the analytic part and no Hilbert transformations are needed. If you keep only the real portions of the coefficients then there'll be an image reflected across zero.
>even though i hate using pseudo-LaTeX math on USENET (i prefer my own >flavor of ASCII math), i'm gonna do that now: > > h[n] is the FIR you're starting with. > > \hat{h}[n] is the Hilbert transform of h[n] > (or some FIR approximation of it, like how MATLAB does it) > > h_a[n] = h[n] + j \hat{h}[n] the analytic signal of h[n] > >you can do that without Hilbert if you DFT it, zero the latter half (or >negative frequencies) while doubling the firster half (the positive >frequencies). that's the MATLAB way. > > e^{j \omega n} h_a[n] is the frequency shifted h_a[n] > > g[n] = \Re \{ e^{j \omega n} h_a[n] \} > > = h[n] \cos(\omega n) + \hat{h}[n] \sin(\omega n) > > >that's what i meant, Tim. > >now h[n] has even symmetry (about the center sample) and \hat{h}[n] has >odd symmetry (about the center sample), so both are, in their own way, >phase linear. and they remain so (in the same even/odd sense) when you >multiply by cos() or sin() (assume that both cos() and sin() are >delayed to be even and odd around the center sample). but when you add >an even symmetry to an odd symmetry function, you don't get either >symmetry (unless one is zero everywhere). > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." > >
Eric Jacobsen Anchor Hill Communications www.anchorhill.com