On Fri, 13 Apr 2012 12:11:05 -0500, Tim Wescott <tim@seemywebsite.com>
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.
[Snipped by Lyons]
Hi,
Yep, you're correct. However, to ensure that the
"shifted" filter is linear phase the sinusoid's time
samples *MUST* be symmetrical. Which means the
sinusoid's time samples will probably NOT start at
zero phase.
See Ya',
[-Rick-]
Reply by mnentwig●April 19, 20122012-04-19
>> by simply multiplying by 2*cos(w*n).
.. which is BTW very close to multiplication with the rotating exp(i...)
phasor, if I use 2 cos(x) = exp(ix) + exp(-ix).
That means, cos() will create mirror images at positive AND negative
frequencies but real-valued coefficients remain real. And modulation with
exp(i...) gives a one-sided filter with complex-valued coefficients.
Reply by robert bristow-johnson●April 15, 20122012-04-15
On 4/15/12 1:10 AM, Tim Wescott wrote:
> On Sat, 14 Apr 2012 17:39:13 -0700, Fred Marshall wrote:
>
>>>
>>
>> What's the purpose here?
>>
>> r b-j mentioned redesign. That's cheap, fast and effective. Why not?
>> Or is this an exercise in math?
>>
maybe it is, but i agree with Tim that if Kaz is trying to scoot his FIR
up from being resonant at DC (i guess we call those "low-pass filters")
to resonant at something that's higher than DC, you can do that
effectively by simply multiplying by 2*cos(w*n). i just hadn't
understood that specifically from what Kaz was saying.
> I don't know what Kaz is up to, but designing bandpass FIR filters by
> designing a lowpass prototype, then modulating it up to the desired
> center frequency, is a pretty common design technique.
i agree. i just never caught that from the OP.
--
r b-j rbj@audioimagination.com
"Imagination is more important than knowledge."
Reply by Tim Wescott●April 15, 20122012-04-15
On Sat, 14 Apr 2012 17:39:13 -0700, Fred Marshall wrote:
> On 4/13/2012 2:20 PM, kaz wrote:
>>> Try multiplying by exp(j*2*pi*(-15:15)*.13) instead of exp(j*2*pi*
>>> (0:30)*.13). Assuming that you're starting with a filter that has
>>> even symmetry around the middle, that will make your resulting filter
>>> even- symmetric in the inphase and odd-symmetric in the quadrature,
>>> which should make the phase delay constant.
>>>
>>> Tim Wescott, Communications, Control, Circuits& Software
>>> http://www.wescottdesign.com
>>>
>>>
>> Thanks for that. Indeed that is what I found out now.
>>
>> Kadhiem
>
> What's the purpose here?
>
> r b-j mentioned redesign. That's cheap, fast and effective. Why not?
> Or is this an exercise in math?
>
> Fred
I don't know what Kaz is up to, but designing bandpass FIR filters by
designing a lowpass prototype, then modulating it up to the desired
center frequency, is a pretty common design technique.
--
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
Reply by Fred Marshall●April 14, 20122012-04-14
On 4/13/2012 2:20 PM, kaz wrote:
>> Try multiplying by exp(j*2*pi*(-15:15)*.13) instead of exp(j*2*pi*
>> (0:30)*.13). Assuming that you're starting with a filter that has even
>> symmetry around the middle, that will make your resulting filter even-
>> symmetric in the inphase and odd-symmetric in the quadrature, which
>> should make the phase delay constant.
>>
>> Tim Wescott, Communications, Control, Circuits& Software
>> http://www.wescottdesign.com
>>
>
> Thanks for that. Indeed that is what I found out now.
>
> Kadhiem
What's the purpose here?
r b-j mentioned redesign. That's cheap, fast and effective. Why not?
Or is this an exercise in math?
Fred
Reply by robert bristow-johnson●April 14, 20122012-04-14
On 4/13/12 4:48 PM, Tim Wescott wrote:
> On Fri, 13 Apr 2012 15:42:48 -0400, robert bristow-johnson wrote:
>
>> okay, so here is the kernel: please teach me, starting from a
>> real-valued bandpass (meaning the spectrum is zero around the baseband,
>> as if it were DSB-AM) signal x[n] to a I/Q without the *equivalent* of
>> the H.T.? (very sharp filters that kill one sideband without touching
>> the other is the frequency-domain equivalent.)
>
> You ask the wrong question, and a different one from which Kaz asked.
>
> The one that Kaz asked was how do you start with a real-valued LOWpass
> prototype, and make it BANDpass. And that's the question that Eric and I
> answered.
well, i'll concede that you connected to Kaz's problem (as he said so),
but i looked again and nowhere did i find him/her writing that he/she
needed to shift the frequency "centre" from DC to something else. the
words that i read was that he/she needed to move the center frequency of
an FIR filter. (as if he/she was starting with an FIR filter with a
center frequency that needed to be shifted.) never read "lowpass" anywhere.
> You are asking how you start with a real-valued BANDpass filter (which
> responds to both positive and negative frequencies) and make it into a
> complex-valued BANDpass filter which responds to just positive (or
> negative) frequencies.
>
> That, does, indeed, require a Hilbert transform or similar. But it's not
> the question at hand.
yeah, if you're mapping an LPF to a BPF, multiply the real impulse
response by 2*cos(w*n). and, as you pointed out, with the symmetry of
the cos() function centered at the same place the FIR is centered at.
continuing to be a life-long student...
--
r b-j rbj@audioimagination.com
"Imagination is more important than knowledge."
Reply by kaz●April 13, 20122012-04-13
>Try multiplying by exp(j*2*pi*(-15:15)*.13) instead of exp(j*2*pi*
>(0:30)*.13). Assuming that you're starting with a filter that has even
>symmetry around the middle, that will make your resulting filter even-
>symmetric in the inphase and odd-symmetric in the quadrature, which
>should make the phase delay constant.
>
>Tim Wescott, Communications, Control, Circuits & Software
>http://www.wescottdesign.com
>
Thanks for that. Indeed that is what I found out now.
Kadhiem
Reply by Tim Wescott●April 13, 20122012-04-13
On Fri, 13 Apr 2012 15:42:48 -0400, robert bristow-johnson wrote:
> On 4/13/12 2:12 PM, Eric Jacobsen wrote:
>>
>> 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.
>
> is the OPs *original* FIR a complex FIR that has zero frequency response
> for "negative" frequency (it's really the latter half of the DFT)? was
> that the given case, because if it were, that got by me.
>
>> If you keep
>> only the real portions of the coefficients then there'll be an image
>> reflected across zero.
>
> yup, we know that. now my question again is *how* do you get that
> analytic signal without either doing:
>
> h[n] + j * Hilbert{ h[n] }
>
> or its equivalent in the frequency domain:
>
> DFT{ h[n] } * 2 * rect((n - N/4)/(N/2))
>
> ??
>
> from an operational POV, where all of our numbers are eventually real
> numbers, if you're shifting something in *one* direction (either up or
> down, but not both), i still do not see how Hilbert (or his counterpart
> in the frequency domain) is avoided.
>
> On 4/13/12 2:52 PM, kaz wrote:
>>>
>>> To turn it into a realizable filter I shall rename the imaginary part
>>> as 'quadrature'.
>
> call it what you want, how're you getting it?
>
>>> And to get a signal without help from Hilbert, I shall
>>> either defer the signal acquisition to another day,
>
> that helps a lot.
>
>>> or I shall use an I/Q
>>> down-converter, neither of which methods require any Hilbert
>>> transforms.
>
> okay, so here is the kernel: please teach me, starting from a
> real-valued bandpass (meaning the spectrum is zero around the baseband,
> as if it were DSB-AM) signal x[n] to a I/Q without the *equivalent* of
> the H.T.? (very sharp filters that kill one sideband without touching
> the other is the frequency-domain equivalent.)
You ask the wrong question, and a different one from which Kaz asked.
The one that Kaz asked was how do you start with a real-valued LOWpass
prototype, and make it BANDpass. And that's the question that Eric and I
answered.
You are asking how you start with a real-valued BANDpass filter (which
responds to both positive and negative frequencies) and make it into a
complex-valued BANDpass filter which responds to just positive (or
negative) frequencies.
That, does, indeed, require a Hilbert transform or similar. But it's not
the question at hand.
>> I am only used to shifting FIR by multiplying it with a complex
>> sinusoid and in Matlab e.g.:
>>
>> h1 = fir1(30,.1);
>> h2 = h1 .* exp(j*2*pi*(0:30)*.13); % shift to .13 of Fs
>>
>> My point is about this approach specifically. h2 loses symmetry.
>
> it also loses its "realness". h1 is real, h2 is complex. my responses
> have been about ultimately keeping it real.
Why? Why do you need to? There are plenty of useful "complex
valued" (quadrature valued if you must be a stickler, but I prefer
complex valued myself) filters out there, happily operating in comms
equipment that turns the signal into quadrature early on in the
processing chain -- perhaps even before things are converted to digital.
> and the reason you need some sorta Hilbert thing going on here, is that
> besides shifting the positive frequency components of h1 up by 0.13*Fs,
> you also shifted the negative frequency components up (in the positive
> direction) by 0.13*Fs, including those components below 0.13*Fs which
> crossed over zero and became new positive frequency components.
>
> did you want to do that (fold those components about DC)? the only way
> to avoid it is to kill all the negative frequency components and you can
> do that in the frequency domain by multiplying by zero, or you do it in
> the time domain by deriving the analytic signal of h1 which uses the
> MATLAB function called "hilbert()".
Or you can do it in the time domain with a quadrature sampler. Really.
>> I see its group delay stays 15 but with unexplained spikes. I doubt
>> these to be true spikes and believe phase stays linear.
I think the spikes come along for real, because of a book-keeping error
in the generation of h2 -- see my post.
> Tim and Eric do communications for a living, i think. but i am
> convinced that i am correct that, if you *do* truly shift the whole
> frequency response of h1 up by anything non-zero, you are at least
> *equivalently* doing that thing with the hilbert transform of h1 that i
> outline. and while a purely even-symmetry part will stay even, and
> while the purely odd-symmetry part (which gets multiplied by zero, when
> h1 is unshifted) will stay odd (and both are phase linear), adding any
> non-zero combination will kill *both* the even and odd symmetrical
> properties (and your result is not phase linear in any sense).
You misunderstand -- I think because you are assuming that Kaz is
starting with a bandpass filter, where he is starting with a lowpass.
Taking the filter response in the frequency domain and shifting it up in
frequency is mathematically the same as convolving it with an impulse at
the desired frequency shift.
Convolution in the frequency domain is equivalent to multiplication in
the time domain.
Kaz is multiplying his desired (but unshifted) prototype filter response
by a complex sinusoid, which is an impulse in the frequency domain -- so
he's getting his desired frequency shift.
>> If I am wrong then how do we frequency translate to preserve FIR
>> quality?
>
> by "FIR quality", you mean the linear phase property of your *specific*
> FIR, right? i will say it again, you need to redesign the FIR (using
> whatever, firpm() or firls() or some windowed technique) to get both,
> the shifted frequency response *and* the linear phase property.
Nope nope nope. Kaz is almost doing exactly the right thing.
--
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
Reply by Tim Wescott●April 13, 20122012-04-13
On Fri, 13 Apr 2012 13:52:56 -0500, kaz wrote:
>>On Fri, 13 Apr 2012 13:49:01 -0400, robert bristow-johnson 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)?
>>
>>To turn it into a realizable filter I shall rename the imaginary part as
>>'quadrature'. And to get a signal without help from Hilbert, I shall
>>either defer the signal acquisition to another day, or I shall use an
>>I/Q
>
>>down-converter, neither of which methods require any Hilbert transforms.
>>
>>--
>>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
>>
>>
> I am only used to shifting FIR by multiplying it with a complex sinusoid
> and in Matlab e.g.:
>
> h1 = fir1(30,.1);
> h2 = h1 .* exp(j*2*pi*(0:30)*.13); % shift to .13 of Fs
>
> My point is about this approach specifically. h2 loses symmetry. I see
> its group delay stays 15 but with unexplained spikes. I doubt these to
> be true spikes and believe phase stays linear.
>
> If I am wrong then how do we frequency translate to preserve FIR
> quality?
h1 is symmetrical around its center point -- yes?
And you are multiplying it by something that is not symmetrical around
its center point -- yes?
Try multiplying by exp(j*2*pi*(-15:15)*.13) instead of exp(j*2*pi*
(0:30)*.13). Assuming that you're starting with a filter that has even
symmetry around the middle, that will make your resulting filter even-
symmetric in the inphase and odd-symmetric in the quadrature, which
should make the phase delay constant.
I'd be able to reel of my reasoning, but it's buried in a non-verbal part
of my brain right now, and I'm not even sure if I'm right -- so try it,
then backfill the math on your own or start a new thread asking why.
--
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
Reply by robert bristow-johnson●April 13, 20122012-04-13
On 4/13/12 2:12 PM, Eric Jacobsen wrote:
>
> 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.
is the OPs *original* FIR a complex FIR that has zero frequency response
for "negative" frequency (it's really the latter half of the DFT)? was
that the given case, because if it were, that got by me.
> If you keep
> only the real portions of the coefficients then there'll be an image
> reflected across zero.
yup, we know that. now my question again is *how* do you get that
analytic signal without either doing:
h[n] + j * Hilbert{ h[n] }
or its equivalent in the frequency domain:
DFT{ h[n] } * 2 * rect((n - N/4)/(N/2))
??
from an operational POV, where all of our numbers are eventually real
numbers, if you're shifting something in *one* direction (either up or
down, but not both), i still do not see how Hilbert (or his counterpart
in the frequency domain) is avoided.
On 4/13/12 2:52 PM, kaz wrote:
>>
>> To turn it into a realizable filter I shall rename the imaginary part as
>> 'quadrature'.
call it what you want, how're you getting it?
>> And to get a signal without help from Hilbert, I shall
>> either defer the signal acquisition to another day,
that helps a lot.
>> or I shall use an I/Q
>> down-converter, neither of which methods require any Hilbert transforms.
okay, so here is the kernel: please teach me, starting from a
real-valued bandpass (meaning the spectrum is zero around the baseband,
as if it were DSB-AM) signal x[n] to a I/Q without the *equivalent* of
the H.T.? (very sharp filters that kill one sideband without touching
the other is the frequency-domain equivalent.)
> I am only used to shifting FIR by multiplying it with a complex sinusoid
> and in Matlab e.g.:
>
> h1 = fir1(30,.1);
> h2 = h1 .* exp(j*2*pi*(0:30)*.13); % shift to .13 of Fs
>
> My point is about this approach specifically.
> h2 loses symmetry.
it also loses its "realness". h1 is real, h2 is complex. my responses
have been about ultimately keeping it real.
and the reason you need some sorta Hilbert thing going on here, is that
besides shifting the positive frequency components of h1 up by 0.13*Fs,
you also shifted the negative frequency components up (in the positive
direction) by 0.13*Fs, including those components below 0.13*Fs which
crossed over zero and became new positive frequency components.
did you want to do that (fold those components about DC)? the only way
to avoid it is to kill all the negative frequency components and you can
do that in the frequency domain by multiplying by zero, or you do it in
the time domain by deriving the analytic signal of h1 which uses the
MATLAB function called "hilbert()".
> I see its group delay stays 15 but with unexplained
> spikes. I doubt these to be true spikes and believe phase stays linear.
Tim and Eric do communications for a living, i think. but i am
convinced that i am correct that, if you *do* truly shift the whole
frequency response of h1 up by anything non-zero, you are at least
*equivalently* doing that thing with the hilbert transform of h1 that i
outline. and while a purely even-symmetry part will stay even, and
while the purely odd-symmetry part (which gets multiplied by zero, when
h1 is unshifted) will stay odd (and both are phase linear), adding any
non-zero combination will kill *both* the even and odd symmetrical
properties (and your result is not phase linear in any sense).
> If I am wrong then how do we frequency translate to preserve FIR quality?
by "FIR quality", you mean the linear phase property of your *specific*
FIR, right? i will say it again, you need to redesign the FIR (using
whatever, firpm() or firls() or some windowed technique) to get both,
the shifted frequency response *and* the linear phase property.
--
r b-j rbj@audioimagination.com
"Imagination is more important than knowledge."