From: gretzteam on 23 Mar 2010 09:41 Hi, I'm having problem getting rid of a 2kHz sine wave from a digitized signal at 128kHz. I do know the exact frequency of the 2kHz (I generate it in the first place with a DDS), but the phase/amplitude are unknown (it goes through DAC->ADC. Now, there seems to be two approach to do this, and I don't know what would be best. 1) Simple IIR 2nd order notch filter. I can center the notch at exactly 2kHz. It gets trick when quantizing the coefficients but it seems doable to get 60dB with 14 bits. The problem is that the notch has to be very narrow to avoid huge ringing in the step response. Is there a way to improve the step response here? 2) Use some kind of adaptive scheme to find out the 2kHz sine/cosine component in the incoming signal and remove it. I wouldn't know where to start with such an approach. Can anyone elaborate on what the time domain response would be when compared to the simple notch? This is all real time. Thanks!
From: Clay on 23 Mar 2010 10:10 On Mar 23, 9:41 am, "gretzteam" <gretzteam(a)n_o_s_p_a_m.yahoo.com> wrote: > Hi, > I'm having problem getting rid of a 2kHz sine wave from a digitized signal > at 128kHz. I do know the exact frequency of the 2kHz (I generate it in the > first place with a DDS), but the phase/amplitude are unknown (it goes > through DAC->ADC. > > Now, there seems to be two approach to do this, and I don't know what would > be best. > > 1) Simple IIR 2nd order notch filter. I can center the notch at exactly > 2kHz. It gets trick when quantizing the coefficients but it seems doable to > get 60dB with 14 bits. The problem is that the notch has to be very narrow > to avoid huge ringing in the step response. > Is there a way to improve the step response here? > > 2) Use some kind of adaptive scheme to find out the 2kHz sine/cosine > component in the incoming signal and remove it. I wouldn't know where to > start with such an approach. Can anyone elaborate on what the time domain > response would be when compared to the simple notch? > > This is all real time. > > Thanks! The notch approach is simplest but instead of trying it with a single very high "q" 2nd order filter, just cascade several lower "q" 2nd order filters in series. IHTH, Clay
From: gretzteam on 23 Mar 2010 10:20 >The notch approach is simplest but instead of trying it with a single >very high "q" 2nd order filter, just cascade several lower "q" 2nd >order filters in series. > >IHTH, >Clay Hi, Are you saying a few even narrower notch in series with slightly different center frequency? Thanks!
From: rickman on 23 Mar 2010 11:25 On Mar 23, 9:41 am, "gretzteam" <gretzteam(a)n_o_s_p_a_m.yahoo.com> wrote: > Hi, > I'm having problem getting rid of a 2kHz sine wave from a digitized signal > at 128kHz. I do know the exact frequency of the 2kHz (I generate it in the > first place with a DDS), but the phase/amplitude are unknown (it goes > through DAC->ADC. > > Now, there seems to be two approach to do this, and I don't know what would > be best. > > 1) Simple IIR 2nd order notch filter. I can center the notch at exactly > 2kHz. It gets trick when quantizing the coefficients but it seems doable to > get 60dB with 14 bits. The problem is that the notch has to be very narrow > to avoid huge ringing in the step response. > Is there a way to improve the step response here? > > 2) Use some kind of adaptive scheme to find out the 2kHz sine/cosine > component in the incoming signal and remove it. I wouldn't know where to > start with such an approach. Can anyone elaborate on what the time domain > response would be when compared to the simple notch? > > This is all real time. > > Thanks! 60 dB sounds pretty aggressive for a subtraction scheme, but it may be possible. You need to use a PLL to generate a 2 kHz sine wave in phase with your incoming signal (better, use your original source). By using a LPF with a very low cutoff in the PLL, it will not respond to transient components in your desired signal. You need then to measure the amplitude of the interfering tone. Then you can subtract the output of the PLL with the appropriate amplitude. If it is constant, you can adjust the level of the subtracted tone until you optimize the result. Otherwise you will need a narrow band pass to measure it in real time. I can't say that you will get 60 dB of attenuation. That would mean you have to match the phase very accurately and match the subtracted tone amplitude to the interfering tone to at least an accuracy of 0.1%. Think you are up to that? Rick
From: Tim Wescott on 23 Mar 2010 12:32
gretzteam wrote: > Hi, > I'm having problem getting rid of a 2kHz sine wave from a digitized signal > at 128kHz. I do know the exact frequency of the 2kHz (I generate it in the > first place with a DDS), but the phase/amplitude are unknown (it goes > through DAC->ADC. > > Now, there seems to be two approach to do this, and I don't know what would > be best. > > 1) Simple IIR 2nd order notch filter. I can center the notch at exactly > 2kHz. It gets trick when quantizing the coefficients but it seems doable to > get 60dB with 14 bits. The problem is that the notch has to be very narrow > to avoid huge ringing in the step response. > Is there a way to improve the step response here? The widest possible notch filter has a denominator of z^2, and will only 'ring' for two steps -- but it may be a bit too wide for you. You could play with longer, narrower FIR notch filters, if you don't mind their "FIR"-ness. Like Clay said -- multiple, lower-Q (wider) filters in cascade will probably help. This would approach the performance of the above-mentioned FIR notch, with all the attendant complications of using an IIR filter. If it makes sense, you could use a notch filter whose gains can be switched -- make it wide to acquire the tone, then narrow it up as time goes by to avoid the ringing on a step. This is a good place to use a Kalman filter* in fact, or to start by designing a Kalman filter to take out the tone, then treat it as a probably-too-complicated time-varying filter that you then simplify to your desires and needs. For that matter, you could make your time-varying filter adaptive, by sensing when seriously mis-estimating the tone. This is a minefield, because distinguishing between a badly-estimated tone and noise gets iffy, but depending on your requirements it may be a necessary one. > 2) Use some kind of adaptive scheme to find out the 2kHz sine/cosine > component in the incoming signal and remove it. I wouldn't know where to > start with such an approach. Can anyone elaborate on what the time domain > response would be when compared to the simple notch? a: Lock onto the tone with a PLL. If you know the frequency _exactly_ then you just need to find phase and amplitude; if there is much phase uncertainty then you'll need to adjust frequency as well. Done right this is going to end up behaving an awful lot like a notch filter, so there's really only a tactical gain here -- if the PLL solution with all its decorations is easier for you to understand and explain in your documentation than the notch filter, that's the way to go. a1: The PLL can be made to be time varying easier than the Kalman can, ditto with adaptive. a2: The PLL approach will probably be more complex than the IIR notch approach, but if the code is more clear... * If you search through the group you'll see me stomping on the notion of a Kalman filter as grasping for a magic solution -- so you know I must be serious here! -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com |