Hi, I'm receiving a signal at 100kHz and need to do two things at the same time: -notch the 2k frequency. -rough detection of the presence of 2k frequency. So basically the notch filter is always there, but I also want to know if something is being notched. I could obviously have in parallel a bandpass filter at 2k and monitor the signal at the output. However I wonder if the answer isn't already within the notch filter. Would there be a way to see if the notch filter was doing any work by looking at some internal values within the filter... I'm using a 4th order butterworth DirectForm-II SOS notch filter. Any idea

# Detecting if a notch filter is 'notching' something!

Started by ●January 27, 2010

Reply by ●January 27, 20102010-01-27

On Jan 27, 4:04�pm, "gretzteam" <gretzt...@yahoo.com> wrote:> Hi, > I'm receiving a signal at 100kHz and need to do two things at the same > time: > > -notch the 2k frequency. > -rough detection of the presence of 2k frequency. > > So basically the notch filter is always there, but I also want to know if > something is being notched. > > I could obviously have in parallel a bandpass filter at 2k and monitor the > signal at the output. However I wonder if the answer isn't already within > the notch filter. Would there be a way to see if the notch filter was doing > any work by looking at some internal values within the filter... > > I'm using a 4th order butterworth DirectForm-II SOS notch filter. > > Any ideaEnergy into the filter compared to energy out of the filter?

Reply by ●January 27, 20102010-01-27

Dirk Bell wrote:> On Jan 27, 4:04 pm, "gretzteam" <gretzt...@yahoo.com> wrote: >> Hi, >> I'm receiving a signal at 100kHz and need to do two things at the same >> time: >> >> -notch the 2k frequency. >> -rough detection of the presence of 2k frequency. >> >> So basically the notch filter is always there, but I also want to know if >> something is being notched. >> >> I could obviously have in parallel a bandpass filter at 2k and monitor the >> signal at the output. However I wonder if the answer isn't already within >> the notch filter. Would there be a way to see if the notch filter was doing >> any work by looking at some internal values within the filter... >> >> I'm using a 4th order butterworth DirectForm-II SOS notch filter. >> >> Any idea > > Energy into the filter compared to energy out of the filter?Use a linear-phase FIR bandpass filter for the signal-detect function. For the notch function, subtract the output of the band-pass filter from an appropriately delayed version of the original signal. Regards, John

Reply by ●January 28, 20102010-01-28

On Wed, 27 Jan 2010 15:04:45 -0600, gretzteam wrote:> Hi, > I'm receiving a signal at 100kHz and need to do two things at the same > time: > > -notch the 2k frequency. > -rough detection of the presence of 2k frequency. > > So basically the notch filter is always there, but I also want to know > if something is being notched. > > I could obviously have in parallel a bandpass filter at 2k and monitor > the signal at the output. However I wonder if the answer isn't already > within the notch filter. Would there be a way to see if the notch filter > was doing any work by looking at some internal values within the > filter... > > I'm using a 4th order butterworth DirectForm-II SOS notch filter. > > Any ideaA notch filter is basically a unity-gain, zero-phase shift resonator whose output gets subtracted from the input signal. So figure out where that resonator is in your filter, and monitor it -- when it shows energy, it's detecting your tone. -- www.wescottdesign.com

Reply by ●January 28, 20102010-01-28

>A notch filter is basically a unity-gain, zero-phase shift resonator >whose output gets subtracted from the input signal.>So figure out where that resonator is in your filter, and monitor it -- >when it shows energy, it's detecting your tone. >www.wescottdesign.comThis is what I don't understand well. How can a sum of SOS be a 'resonator whose output gets subtracted from the input'? Are you talking about another Notch filter structure that would match this more closely? Thanks,

Reply by ●January 28, 20102010-01-28

gretzteam wrote:>> A notch filter is basically a unity-gain, zero-phase shift resonator >> whose output gets subtracted from the input signal. > >> So figure out where that resonator is in your filter, and monitor it -- >> when it shows energy, it's detecting your tone. >> www.wescottdesign.com > > This is what I don't understand well. How can a sum of SOS be a 'resonator > whose output gets subtracted from the input'? > Are you talking about another Notch filter structure that would match this > more closely? > > Thanks,You can make it in reverse: Take a suitably delayed copy of the input signal and subtract the notched signal from it. The difference is what is notched out. -- Tauno Voipio

Reply by ●January 29, 20102010-01-29

Tauno Voipio wrote:> gretzteam wrote: >>> A notch filter is basically a unity-gain, zero-phase shift resonator >>> whose output gets subtracted from the input signal. >> >>> So figure out where that resonator is in your filter, and monitor it >>> -- when it shows energy, it's detecting your tone. www.wescottdesign.com >> >> This is what I don't understand well. How can a sum of SOS be a >> 'resonator >> whose output gets subtracted from the input'? Are you talking about >> another Notch filter structure that would match this >> more closely? >> >> Thanks, > > > You can make it in reverse: Take a suitably delayed copy > of the input signal and subtract the notched signal from > it. The difference is what is notched out. >Not if the OP uses his 4th order butterworth DirectForm-II SOS notch filter. For subtraction to work the filter must have a linear phase. Regards, John

Reply by ●January 29, 20102010-01-29

On Fri, 29 Jan 2010 17:35:11 +1100, John Monro <johnmonro@optusnet.com.au> wrote:>For subtraction to work the filter must >have a linear phase.A generic 2nd-order notch filter: . s� + A� . ------------ . s� + Bs + A� "One minus a generic 2nd-order notch filter": . s� + A� . 1 - ------------ . s� + Bs + A� . . s� + Bs + A� - (s� + A�) . = ------------------------ . s� + Bs + A� . . Bs . = ------------ . s� + Bs + A� ... which is a bandpass filter. Neither the notch filter nor the bandpass filter is linear phase. Greg

Reply by ●January 29, 20102010-01-29

On Thu, 28 Jan 2010 08:09:25 -0600, gretzteam wrote:>>A notch filter is basically a unity-gain, zero-phase shift resonator >>whose output gets subtracted from the input signal. > >>So figure out where that resonator is in your filter, and monitor it -- >>when it shows energy, it's detecting your tone. www.wescottdesign.com > > This is what I don't understand well. How can a sum of SOS be a > 'resonator whose output gets subtracted from the input'? Are you talking > about another Notch filter structure that would match this more closely? > > Thanks,The feedback half of each second order section is a resonator, the output half (the b0-b2 coefficients) are what makes it a notch, high-, low-, or band-pass. The arrangement of these output coefficients into a notch configuration are effectively subtracting a bandpass filter from the initial signal -- really. Knowing the states at any given time will uniquely determine the amount of energy in the filter. You have two filter sections; correctly sum up the energy from each one and you'll know how much energy is being notched out. You _are_ going to have to do some math here -- that's life for a DSP engineer. -- www.wescottdesign.com

Reply by ●January 30, 20102010-01-30

Greg Berchin wrote:> On Fri, 29 Jan 2010 17:35:11 +1100, John Monro <johnmonro@optusnet.com.au> > wrote: > >> For subtraction to work the filter must >> have a linear phase. > > A generic 2nd-order notch filter: > > . s� + A� > . ------------ > . s� + Bs + A� > > "One minus a generic 2nd-order notch filter": > > . s� + A� > . 1 - ------------ > . s� + Bs + A� > . > . s� + Bs + A� - (s� + A�) > . = ------------------------ > . s� + Bs + A� > . > . Bs > . = ------------ > . s� + Bs + A� > > ... which is a bandpass filter. > > Neither the notch filter nor the bandpass filter is linear phase. > > GregYou are quite right Greg. What I was thinking of was the situation where the 'notch' filter is a reasonably flat band-reject filter, but of course this would have a much higher order than second-order filter mentioned by the OP. With a nice flat higher-order band-reject filter the subtraction scheme does not work well because the phase shift either side of centre frequency messes up the amplitude response when you do the subtraction. at passband. Regards, John