|
Prev: GMSK MODEM
Next: DTMF detection through Sound Card
From: Michel Rouzic on 11 Jan 2006 00:23 I want to implement a Hilbert transform, but i'd like to avoid having to deal with a kernel to convolute with, mainly because I wouldn't know how many taps I'd need and whether I should make a odd or even kernel, and also because this way it seems to give such an unperfect result. Since Hilbert Transform is basically about shifting the phase by 90°, I thought of a few ways to do it, but I'm not sure whether or not it would give just what a Hilbert Transform would give (mostly as for the negative frequencies, which is not such an easy concept to master) To perform an Hilbert Transform on a signal, could I perform a FFT on a signal, and then make the imaginary part equal the real part and the real part equal minus the imaginary part, so it would do as if both parts had rotated by +j? I also read in a book that the analytic signal's real part is equal to the original real input signal. i got a little problem with that, it seems to me that it says that the analytic signal's real part is the input signal's real part, as if we discared the input signal's imaginary part. I probably got it wrong, so if someone could enlight me...
From: Jerry Avins on 11 Jan 2006 11:29 Michel Rouzic wrote: > I want to implement a Hilbert transform, but i'd like to avoid having > to deal with a kernel to convolute with, mainly because I wouldn't know > how many taps I'd need Pick a number and see it it meets your spec. If too poor, make it bigger. If better than need be, make it smaller. Obviously, the minimum number of taps will provide a delay equal to a quarter period of the lowest frequency; in practice, you need a little more. > and whether I should make a odd or even kernel, Odd has the advantages that the signal at the middle tap has the same delay as the transformer output and the delay is a whole number of sample times. With an even number of taps, you get a (usually trivial) improvement in the high-frequency band edge of Q, but you need half a sample time delay in I. > and also because this way it seems to give such an unperfect result. There is no better result to be had. There are cheaper ones, though. > I thought of a few ways to do it, but I'm not sure whether or not it > would give just what a Hilbert Transform would give (mostly as for the > negative frequencies, which is not such an easy concept to master) > > To perform an Hilbert Transform on a signal, could I perform a FFT on a > signal, and then make the imaginary part equal the real part and the > real part equal minus the imaginary part, so it would do as if both > parts had rotated by +j? For continuous processing, you would need to string the IFFTs together with overlap. A Hilbert transform is done with convolution, just like most FIRs. Any of those can be accomplished with FFT-IFFT. Look up "fast convolution". > I also read in a book that the analytic signal's real part is equal to > the original real input signal. i got a little problem with that, it > seems to me that it says that the analytic signal's real part is the > input signal's real part, as if we discared the input signal's > imaginary part. I probably got it wrong, so if someone could enlight > me... You understand that to make an analytic signal, you perform a Hilbert transformation on it in order to generate the imaginary part. You now have two parts, real* and imaginary, which together are the analytic (complex) signal. If the imaginary part is discarded, you are back to the signal you started with. Jerry ______________________________________ * Of course, the original (real) part must be delayed to match the processing delay of the Hilbert transformation. -- Engineering is the art of making what you want from things you can get. ???????????????????????????????????????????????????????????????????????
From: john on 11 Jan 2006 17:26 Michel Rouzic wrote: > I want to implement a Hilbert transform, but i'd like to avoid having > to deal with a kernel to convolute with, mainly because I wouldn't know > how many taps I'd need and whether I should make a odd or even kernel, > and also because this way it seems to give such an unperfect result. > > Since Hilbert Transform is basically about shifting the phase by 90°, > I thought of a few ways to do it, but I'm not sure whether or not it > would give just what a Hilbert Transform would give (mostly as for the > negative frequencies, which is not such an easy concept to master) > > To perform an Hilbert Transform on a signal, could I perform a FFT on a > signal, and then make the imaginary part equal the real part and the > real part equal minus the imaginary part, so it would do as if both > parts had rotated by +j? > > I also read in a book that the analytic signal's real part is equal to > the original real input signal. i got a little problem with that, it > seems to me that it says that the analytic signal's real part is the > input signal's real part, as if we discared the input signal's > imaginary part. I probably got it wrong, so if someone could enlight > me... What I do is take a real FFT of the taps, then zero the negative frequencies. That gives me a template to multiply the FFT of the input block by before performing inverse FFT and OLA. John
From: Rick Lyons on 11 Jan 2006 17:58 On 10 Jan 2006 21:23:19 -0800, "Michel Rouzic" <Michel0528(a)yahoo.fr> wrote: >I want to implement a Hilbert transform, but i'd like to avoid having >to deal with a kernel to convolute with, mainly because I wouldn't know >how many taps I'd need and whether I should make a odd or even kernel, >and also because this way it seems to give such an unperfect result. > >Since Hilbert Transform is basically about shifting the phase by 90=B0, >I thought of a few ways to do it, but I'm not sure whether or not it >would give just what a Hilbert Transform would give (mostly as for the >negative frequencies, which is not such an easy concept to master) > >To perform an Hilbert Transform on a signal, could I perform a FFT on a >signal, and then make the imaginary part equal the real part and the >real part equal minus the imaginary part, so it would do as if both >parts had rotated by +j? Hi, off the top of my head, I don't think this will work. Sorry but I don't have the time to model this idea, but I'll bet you can find the answer pretty quick if you model this yourself with some software (MATLAB, MathCAD, Scilab, etc.). >I also read in a book that the analytic signal's real part is equal to >the original real input signal. i got a little problem with that, it >seems to me that it says that the analytic signal's real part is the >input signal's real part, as if we discared the input signal's >imaginary part. I probably got it wrong, so if someone could enlight >me... It sounds to me like you have a real signal, and you want to compute an analytic signal. (That's typically what the Hilbert transform is used for.) One way to generate an analytic signal is to perform the FFT of your original real signal. Next, zero-out all of the FFT results negative frequency components. (This will give you a spectrum having only positive-frequency components.) Then perform the inverse FFT of that new spectrum. The result of the inverse FFT will be your desired analytic signal, and the real part of the analytic signal will be the original a real signal samples that you started with. Good Luck, [-Rick-]
From: Michel Rouzic on 14 Jan 2006 02:27
Rick Lyons wrote: > On 10 Jan 2006 21:23:19 -0800, "Michel Rouzic" <Michel0528(a)yahoo.fr> > wrote: > > >I want to implement a Hilbert transform, but i'd like to avoid having > >to deal with a kernel to convolute with, mainly because I wouldn't know > >how many taps I'd need and whether I should make a odd or even kernel, > >and also because this way it seems to give such an unperfect result. > > > >Since Hilbert Transform is basically about shifting the phase by 90=B0, > >I thought of a few ways to do it, but I'm not sure whether or not it > >would give just what a Hilbert Transform would give (mostly as for the > >negative frequencies, which is not such an easy concept to master) > > > >To perform an Hilbert Transform on a signal, could I perform a FFT on a > >signal, and then make the imaginary part equal the real part and the > >real part equal minus the imaginary part, so it would do as if both > >parts had rotated by +j? > > Hi, > > off the top of my head, I don't think this will > work. Sorry but I don't have the time to > model this idea, but I'll bet you can find the > answer pretty quick if you model this yourself > with some software (MATLAB, MathCAD, Scilab, etc.). Main reason for that is that I have no idea of what it would do in the negative frequencies, mostly that so far I just thought that negative frequencies were somehow the mirror of positive frequencies. > >I also read in a book that the analytic signal's real part is equal to > >the original real input signal. i got a little problem with that, it > >seems to me that it says that the analytic signal's real part is the > >input signal's real part, as if we discared the input signal's > >imaginary part. I probably got it wrong, so if someone could enlight > >me... > > It sounds to me like you have a real signal, and you > want to compute an analytic signal. (That's typically > what the Hilbert transform is used for.) > > One way to generate an analytic signal is to perform the FFT of your > original real signal. Next, zero-out all of the FFT results negative > frequency components. (This will give you a spectrum having only > positive-frequency components.) Then perform the inverse FFT of that > new spectrum. The result of the inverse FFT will be your desired > analytic signal, and the real part of the analytic signal will be the > original a real signal samples that you started with. > > Good Luck, > [-Rick-] wow, wait, does Matlab/Scilab gives you both negative and positive frequencies, or is there something I didn't understand about telling a positive frequency from a negative one? Because I use FFTW 3 in my C program to perform my FFT's, and well all I see as a result is positive frequencies. I would surely have thought about zeroing negative frequencies to get an analytic signal if it displayed negative frequencies. That whole negative frequency thing is quite confusing, mostly that I didn't see anywhere how negative frequencies look compared to positive frequencies in the time domain. But i'll quit complaining, i'd just like to know how I can get negative frequencies from the FFT returned by FFTW 3 and zero them. Thanks. |