Reply by Dirk Bell March 25, 20102010-03-25
On Mar 24, 6:11&#2013266080;pm, "gretzteam" <gretzteam@n_o_s_p_a_m.yahoo.com>
wrote:
> >Square pulses at what frequency? > > Well hopefully your heat is not about to explode, so say about 1Hz! Should > be about 100us wide. > > Every notch I'm trying is pretty much killing this, unless I make it really > really narrow. I'm still struggling getting the idea to cascade a few > notches to work. I think I missed the part about filter Q back in college! > > Thanks!
So you have basically a very impulsive rectangular waveform at a 1 Hz repetition rate with harmonics spaced at 1 Hz intervals. That is almost 2000 harmonics before the 2000 Hz tone. Have you done a matlab simulation to see how many hamonics you need for your purposes and what notch width at 2000 Hz works okay (ie how many harmonics you can acceptably remove around 2000 Hz)? Is there anything besides more harmonics above the 2000 Hz tone? Dirk
Reply by gretzteam March 24, 20102010-03-24
>Square pulses at what frequency?
Well hopefully your heat is not about to explode, so say about 1Hz! Should be about 100us wide. Every notch I'm trying is pretty much killing this, unless I make it really really narrow. I'm still struggling getting the idea to cascade a few notches to work. I think I missed the part about filter Q back in college! Thanks!
Reply by Dirk Bell March 24, 20102010-03-24
On Mar 24, 4:22&#2013266080;pm, "gretzteam" <gretzteam@n_o_s_p_a_m.yahoo.com>
wrote:
> Hi, > Ok here are some clarifications: > > >> Has the OP stated to what extent it is important to preserve the > >> signal around 2 KHz or below it? > >> Makes a difference in the solution. > > This is for a medical application. Basic signal flow is: > > DDS -> DAC -> Human body -> ADC -> Decimation -> Detect AND get rid of > 2kHz. > > >> The 2kHz is exact fraction of 128kHz by exact binary ratio of 64. So > >> generating and using it is not a very good idea anyway. > > It's actually close to 2kHz, not dead-on 2k. > > The main problem is that the notch filter, or any other solution, need to > affect square pulses as little as possible. > > Hope this clarifies things a bit. > > Thanks!
Square pulses at what frequency? Dirk
Reply by gretzteam March 24, 20102010-03-24
Hi,
Ok here are some clarifications:

>> Has the OP stated to what extent it is important to preserve the >> signal around 2 KHz or below it? >> Makes a difference in the solution.
This is for a medical application. Basic signal flow is: DDS -> DAC -> Human body -> ADC -> Decimation -> Detect AND get rid of 2kHz.
>> The 2kHz is exact fraction of 128kHz by exact binary ratio of 64. So >> generating and using it is not a very good idea anyway.
It's actually close to 2kHz, not dead-on 2k. The main problem is that the notch filter, or any other solution, need to affect square pulses as little as possible. Hope this clarifies things a bit. Thanks!
Reply by Tim Wescott March 24, 20102010-03-24
Dirk Bell wrote:
> On Mar 23, 8:15 pm, Tim Wescott <t...@seemywebsite.now> wrote: >> Dirk Bell wrote: >>> On Mar 23, 6:34 pm, Tim Wescott <t...@seemywebsite.now> wrote: >>>> gretzteam wrote: >>>>>> The Goertzel filter is just a bandpass filter that you run for a finite >>>>>> amount of time. A notch filter is just your signal minus the output of >>>>>> a bandpass filter. So a scheme that uses a Goertzel filter to >>>>>> periodically measure amplitude and phase is _probably_ not going to work >>>>>> as well as a notch filter. >>>>>> Besides, there are better methods than Goertzel filters if you happen to >>>>>> be on a processor with oodles of resources compared to your problem, as >>>>>> is often the case these days. >>>>>> -- >>>>>> Tim Wescott >>>>>> Control system and signal processing consulting >>>>>> www.wescottdesign.com >>>>> Hi, >>>>> Thanks for the comments on the Goertzel filter. I agree that even if I >>>>> could make that to work, I don't see how it could beat a simple notch >>>>> filter. >>>>> I'm actually implementing this in straight hardware where power/area is a >>>>> concern. I would be interested in knowing if anything could better than the >>>>> Goertzel filter in this case (let's say I was trying to 'detect' this tone >>>>> instead of removing it). >>>> The complexity of a Goertzel is pretty much exactly the same as the >>>> complexity of a unity-gain bandpass or a notch. I'd use that. >>>> If you can stand detecting harmonics of the tone, demodulate it with a >>>> 2kHz square wave. That'll catch 2kHz, 6kHz, 10kHz, etc., but >>>> multiplying by 1 or -1 and accumulating sure doesn't use up much circuitry! >>>> If you've got multipliers to spare, then demodulate it with a 2kHz sine >>>> wave (and cosine wave). That'll catch _just_ 2kHz, and give you lots of >>>> control over what you do with the result. (In fact, you could do this >>>> instead of a PLL or a notch filter). >>>> -- >>>> Tim Wescott >>>> Control system and signal processing consultingwww.wescottdesign.com-Hide quoted text - >>>> - Show quoted text - >>> Has the OP stated to what extent it is important to preserve the >>> signal around 2 KHz or below it? >> Nope. >> >> -- >> Tim Wescott >> Control system and signal processing consultingwww.wescottdesign.com- Hide quoted text - >> >> - Show quoted text - > > Makes a difference in the solution. > > Dirk >
True, but the way that he stated it made it sound like the 2kHz signal was there intentionally. Presumably keeping it out of there in the first place isn't a DSP issue. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
Reply by Dirk Bell March 24, 20102010-03-24
On Mar 23, 8:15&#2013266080;pm, Tim Wescott <t...@seemywebsite.now> wrote:
> Dirk Bell wrote: > > On Mar 23, 6:34 pm, Tim Wescott <t...@seemywebsite.now> wrote: > >> gretzteam wrote: > >>>> The Goertzel filter is just a bandpass filter that you run for a finite > >>>> amount of time. &#2013266080;A notch filter is just your signal minus the output of > >>>> a bandpass filter. &#2013266080;So a scheme that uses a Goertzel filter to > >>>> periodically measure amplitude and phase is _probably_ not going to work > >>>> as well as a notch filter. > >>>> Besides, there are better methods than Goertzel filters if you happen to > >>>> be on a processor with oodles of resources compared to your problem, as > >>>> is often the case these days. > >>>> -- > >>>> Tim Wescott > >>>> Control system and signal processing consulting > >>>>www.wescottdesign.com > >>> Hi, > >>> Thanks for the comments on the Goertzel filter. I agree that even if I > >>> could make that to work, I don't see how it could beat a simple notch > >>> filter. > >>> I'm actually implementing this in straight hardware where power/area is a > >>> concern. I would be interested in knowing if anything could better than the > >>> Goertzel filter in this case (let's say I was trying to 'detect' this tone > >>> instead of removing it). > >> The complexity of a Goertzel is pretty much exactly the same as the > >> complexity of a unity-gain bandpass or a notch. &#2013266080;I'd use that. > > >> If you can stand detecting harmonics of the tone, demodulate it with a > >> 2kHz square wave. &#2013266080;That'll catch 2kHz, 6kHz, 10kHz, etc., but > >> multiplying by 1 or -1 and accumulating sure doesn't use up much circuitry! > > >> If you've got multipliers to spare, then demodulate it with a 2kHz sine > >> wave (and cosine wave). &#2013266080;That'll catch _just_ 2kHz, and give you lots of > >> control over what you do with the result. &#2013266080;(In fact, you could do this > >> instead of a PLL or a notch filter). > > >> -- > >> Tim Wescott > >> Control system and signal processing consultingwww.wescottdesign.com-Hide quoted text - > > >> - Show quoted text - > > > Has the OP stated to what extent it is important to preserve the > > signal around 2 KHz or below it? > > Nope. > > -- > Tim Wescott > Control system and signal processing consultingwww.wescottdesign.com- Hide quoted text - > > - Show quoted text -
Makes a difference in the solution. Dirk
Reply by Dirk Bell March 24, 20102010-03-24
On Mar 23, 7:14&#2013266080;pm, Dirk Bell <bellda2...@cox.net> wrote:
> On Mar 23, 6:34&#2013266080;pm, Tim Wescott <t...@seemywebsite.now> wrote: > > > > > > > gretzteam wrote: > > >> The Goertzel filter is just a bandpass filter that you run for a finite > > >> amount of time. &#2013266080;A notch filter is just your signal minus the output of > > >> a bandpass filter. &#2013266080;So a scheme that uses a Goertzel filter to > > >> periodically measure amplitude and phase is _probably_ not going to work > > >> as well as a notch filter. > > > >> Besides, there are better methods than Goertzel filters if you happen to > > >> be on a processor with oodles of resources compared to your problem, as > > >> is often the case these days. > > > >> -- > > >> Tim Wescott > > >> Control system and signal processing consulting > > >>www.wescottdesign.com > > > > Hi, > > > Thanks for the comments on the Goertzel filter. I agree that even if I > > > could make that to work, I don't see how it could beat a simple notch > > > filter. > > > > I'm actually implementing this in straight hardware where power/area is a > > > concern. I would be interested in knowing if anything could better than the > > > Goertzel filter in this case (let's say I was trying to 'detect' this tone > > > instead of removing it). > > > The complexity of a Goertzel is pretty much exactly the same as the > > complexity of a unity-gain bandpass or a notch. &#2013266080;I'd use that. > > > If you can stand detecting harmonics of the tone, demodulate it with a > > 2kHz square wave. &#2013266080;That'll catch 2kHz, 6kHz, 10kHz, etc., but > > multiplying by 1 or -1 and accumulating sure doesn't use up much circuitry! > > > If you've got multipliers to spare, then demodulate it with a 2kHz sine > > wave (and cosine wave). &#2013266080;That'll catch _just_ 2kHz, and give you lots of > > control over what you do with the result. &#2013266080;(In fact, you could do this > > instead of a PLL or a notch filter). > > > -- > > Tim Wescott > > Control system and signal processing consultingwww.wescottdesign.com-Hide quoted text - > > > - Show quoted text - > > Has the OP stated to what extent it is important to preserve the > signal around 2 KHz or below it? > > Dirk- Hide quoted text - > > - Show quoted text -
Makes a difference in the solution. Dirk
Reply by glen herrmannsfeldt March 23, 20102010-03-23
Vladimir Vassilevsky <nospam@nowhere.com> wrote:
(snip, I wrote)
 
>> The best way is to stop generating it in the first place. >> You don't mention that, so I am suggesting it here. Maybe there >> is a reason to generate it, or maybe not...
> The 2kHz is exact fraction of 128kHz by exact binary ratio of 64. So > generating and using it is not a very good idea anyway.
Yes. I was presuming that it was not intentional, but due to some other problem in the digital part of the design. Instead of filtering it out from the analog signal, don't generate it in the first place. Or maybe a digital filter before the DAC could also remove it. All the discussion so far is on filtering the analog signal. -- glen
Reply by Vladimir Vassilevsky March 23, 20102010-03-23

glen herrmannsfeldt wrote:

> gretzteam <gretzteam@n_o_s_p_a_m.yahoo.com> wrote: > > >>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. > > > The best way is to stop generating it in the first place. > You don't mention that, so I am suggesting it here. Maybe there > is a reason to generate it, or maybe not...
The 2kHz is exact fraction of 128kHz by exact binary ratio of 64. So generating and using it is not a very good idea anyway. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by glen herrmannsfeldt March 23, 20102010-03-23
gretzteam <gretzteam@n_o_s_p_a_m.yahoo.com> wrote:

> 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.
The best way is to stop generating it in the first place. You don't mention that, so I am suggesting it here. Maybe there is a reason to generate it, or maybe not... -- glen