Electronic Music mailing list archives

Previous Message: Re: FAQ is BAQ! - frequency shifting.
Next Message: Re: FAQ is BAQ! - frequency shifting.

From: Charles Henry ()
Date: May 8, 2008
Subject: Re: FAQ is BAQ! - frequency shifting.
On Thu, May 8, 2008 at 4:39 PM, robert bristow-johnson
 wrote:
>
>> ----- Original Message -----
>> From: "Charles Henry" 
>> To: "A discussion list for music-related DSP" 
>> Subject: Re: [music-dsp] FAQ is BAQ! - frequency shifting.
>> Date: Thu, 8 May 2008 14:36:14 -0500
>>
>>
>> Quick question, here.  I have sometimes struggled to create a good RT
>> Hilbert transform (I made a couple of pd patches that while appearing
>> to be correct on the surface with relevant math behind it, but
>> produces horrible phase shifts).  How does one make an RT Hilbert
>> transform?
>> (I can also provide details on my method, if desired.)
>
> it's a filter, but a true Hilbert transformer is not causal.
>
> a *delayed* Hilbert transformer (so the constant delay or the linear phase of this has to be accounted for) can be done to any degree of precision (if you're willing to throw taps at it) with an FIR (with a sorta halfband-odd-symmetry) with (non-delayed) impulse response of
>
>    h[n] = (1-(-1)^n) * 1/(pi*n) * w[n]

Okay, this is the same formula I came up with for the ideal response.
It's the Hilbert transform of sinc(n), sampled at the integers (I
think... maybe it's the adjoint...)

But where I went wrong was to look at the following function as an
approximation of it.

x(n)= sum ( k=-N/2:N/2,  sin(2*pi*n*k/N) )

This is a function having unitary frequency response of the DFT on a
block of samples length N, and 90 degrees phase shift.

It *looks* like a good approximation, but it only performs correctly
at the integer multiples of frequencies.  Anything in between turns to
garbage...

Thanks for the help!!

Chuck

>
> where w[n] is a window function that you like.  you can also use MATLAB's remez() or firls() to design an optimal h[n] for a given length.  note that for even n, h[n]=0 (because of halfband-symmetry) which should be incorporated into the FIR code.  of course, you need to delay the whole thing by 1/2 of the width of w[n] and your non-hilberted signal needs to be delayed by the same amount so you have an "in-phase" and "quadrature" pair (albeit a delayed pair of signals).




>
>
> --
> [EMAIL REMOVED] >
> "Imagination is more important than knowledge."
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp
>
--
dupswapdrop -- the music-dsp mailing list and website: 
subscription info, FAQ, source code archive, list archive, book reviews, dsp links 
http://music.columbia.edu/cmc/music-dsp 
http://music.columbia.edu/mailman/listinfo/music-dsp

+Re: FAQ is BAQ! - frequency shifting. robert bristow-johnson (05/08/08)
+---Re: FAQ is BAQ! - frequency shifting. Charles Henry (05/08/08)
+---Re: FAQ is BAQ! - frequency shifting. James Chandler Jr (05/08/08)
+---Re: FAQ is BAQ! - frequency shifting. Vesa Norilo (05/09/08)

Previous Message: Re: FAQ is BAQ! - frequency shifting.
Next Message: Re: FAQ is BAQ! - frequency shifting.