DSPRelated.com
Forums

Sharp DSP notch filter

Started by Eeyore May 20, 2009
I am proposing to engage on a project regarding mains voltage 'purity'
(and absence of ) with regard to audible clicks and pops in high-end
professional and hi-fi audio equipment.

Typical EMC filters operate in the RF band and are threfore no use to
filter audio 'in band' noise that can travel through transformer
interwinding capacitance etc.

I have found some of the TI INA series that will with suitable
preconditioning, tolerate mains voltages and give excellent common-mode
etc rejection. So assembling a 'preamp' front end should be no problem.

What I will need to do however is to filter all the mains frequencies
and harmonics to a very large degree.

I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I
have done only a little DSP ( I can't see it happening with analogue
filters ) and I don't even know where to begin with such a severe filter
without affecting the pass-band. Same will go for harmonics up to some
serious number.

Can  anyone offer some advice as to algorithms ( number of cycles for
such a deep notch ) and even better, a readily available eval board upon
which it could be set up ? Remember I only need to 'hear' audio band, so
44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs
today.

Many thanks,    Graham



Eeyore wrote:
> I am proposing to engage on a project regarding mains voltage 'purity' > (and absence of ) with regard to audible clicks and pops in high-end > professional and hi-fi audio equipment. > > Typical EMC filters operate in the RF band and are threfore no use to > filter audio 'in band' noise that can travel through transformer > interwinding capacitance etc. > > I have found some of the TI INA series that will with suitable > preconditioning, tolerate mains voltages and give excellent common-mode > etc rejection. So assembling a 'preamp' front end should be no problem. > > What I will need to do however is to filter all the mains frequencies > and harmonics to a very large degree. > > I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I > have done only a little DSP ( I can't see it happening with analogue > filters ) and I don't even know where to begin with such a severe filter > without affecting the pass-band. Same will go for harmonics up to some > serious number. > > Can anyone offer some advice as to algorithms ( number of cycles for > such a deep notch ) and even better, a readily available eval board upon > which it could be set up ? Remember I only need to 'hear' audio band, so > 44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs > today.
How does mains noise get into the equipment? Power supplies are filtered and regulated, so any noise you experience must enter by another route. You might look into ferro-resonant transformers. These are primarily intended to regulate load voltage, but they also suppress voltage spikes. http://www.elect-spec.com/trnsreg.htm has examples. A capacitive shield between primary and secondary of the power transformer may be all you need. Isolation transformers are built that way. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
On Thu, 21 May 2009 02:54:36 +0100, Eeyore wrote:

> I am proposing to engage on a project regarding mains voltage 'purity' > (and absence of ) with regard to audible clicks and pops in high-end > professional and hi-fi audio equipment. > > Typical EMC filters operate in the RF band and are threfore no use to > filter audio 'in band' noise that can travel through transformer > interwinding capacitance etc. > > I have found some of the TI INA series that will with suitable > preconditioning, tolerate mains voltages and give excellent common-mode > etc rejection. So assembling a 'preamp' front end should be no problem. > > What I will need to do however is to filter all the mains frequencies > and harmonics to a very large degree. > > I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I > have done only a little DSP ( I can't see it happening with analogue > filters ) and I don't even know where to begin with such a severe filter > without affecting the pass-band. Same will go for harmonics up to some > serious number. > > Can anyone offer some advice as to algorithms ( number of cycles for > such a deep notch ) and even better, a readily available eval board upon > which it could be set up ? Remember I only need to 'hear' audio band, so > 44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs > today. > > Many thanks, Graham
This sounds like an adventure into audiophoolery, which isn't what I'd expect of you. What, exactly, are you planning on filtering, and what are you planning on filtering it against? I suppose that you could filter your power supply rail with a supply that has infinite rejection at all the power line harmonics -- but it seems that a good switcher followed by a good linear regulator for clean up would pound the power-line stuff down by many tens of dB. If you absolutely had to get it down further you could incorporate a resonant element in the feedback of the linear regulator, arranged to provide a good notch. Doing this with a DSP may just make sense in that case. Filtering anything else sounds like flat-out magic. And finally, if it's clicks and pops you're trying to eliminate, that would seem to indicate a problem with transients on the line, which aren't things that you're going to notch out. -- http://www.wescottdesign.com
Eeyore <rabbitsfriendsandrelations@hotmail.com> wrote:

>I am proposing to engage on a project regarding mains voltage 'purity' >(and absence of ) with regard to audible clicks and pops in high-end >professional and hi-fi audio equipment. > >Typical EMC filters operate in the RF band and are threfore no use to >filter audio 'in band' noise that can travel through transformer >interwinding capacitance etc. > >I have found some of the TI INA series that will with suitable >preconditioning, tolerate mains voltages and give excellent common-mode >etc rejection. So assembling a 'preamp' front end should be no problem. > >What I will need to do however is to filter all the mains frequencies >and harmonics to a very large degree. > >I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I >have done only a little DSP ( I can't see it happening with analogue >filters ) and I don't even know where to begin with such a severe filter >without affecting the pass-band. Same will go for harmonics up to some >serious number. > >Can anyone offer some advice as to algorithms ( number of cycles for >such a deep notch ) and even better, a readily available eval board upon >which it could be set up ? Remember I only need to 'hear' audio band, so >44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs >today.
A sharp filter for just one frequency is very easy. One ore more biquad sections (5 multiplies & adds per biquad) are sufficient. That doesn't take a lot of processing power. A cheap & simple ARM microcontroller will do. Still, you should be aware of phase changes near the filter frequencies. I'm quite sure this will alter the sound. However I have to go along with Tim. Filtering 50Hz harmonics is not going to help. The plops and clicks you mention are not a multiples of 50Hz. These are just random spikes on the mains. If these spikes end up in your audio circuitry, then you most likely have a ground loop or another ground related problem somewhere. It means that the current from the spike shares a return path with your audio signal. -- Failure does not prove something is impossible, failure simply indicates you are not using the right tools... "If it doesn't fit, use a bigger hammer!" --------------------------------------------------------------

Jerry Avins wrote:

> Eeyore wrote: > > I am proposing to engage on a project regarding mains voltage 'purity' > > (and absence of ) with regard to audible clicks and pops in high-end > > professional and hi-fi audio equipment. > > > > Typical EMC filters operate in the RF band and are threfore no use to > > filter audio 'in band' noise that can travel through transformer > > interwinding capacitance etc. > > > > I have found some of the TI INA series that will with suitable > > preconditioning, tolerate mains voltages and give excellent common-mode > > etc rejection. So assembling a 'preamp' front end should be no problem. > > > > What I will need to do however is to filter all the mains frequencies > > and harmonics to a very large degree. > > > > I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I > > have done only a little DSP ( I can't see it happening with analogue > > filters ) and I don't even know where to begin with such a severe filter > > without affecting the pass-band. Same will go for harmonics up to some > > serious number. > > > > Can anyone offer some advice as to algorithms ( number of cycles for > > such a deep notch ) and even better, a readily available eval board upon > > which it could be set up ? Remember I only need to 'hear' audio band, so > > 44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs > > today. > > How does mains noise get into the equipment?
That's part of the project. To find out. I suspect many different possibilities but we can't rebuild the equipment so we need to find out what it's suspectible too. Plus we expect to be tackling this problem for many types of equipment.
> Power supplies are filtered > and regulated, so any noise you experience must enter by another > route. You might look into ferro-resonant transformers. These are > primarily intended to regulate load voltage, but they also suppress > voltage spikes. http://www.elect-spec.com/trnsreg.htm has examples. > > A capacitive shield between primary and secondary of the power > transformer may be all you need. Isolation transformers are built that way.
Yup I know. An ultra-isolation transformer will be part of our 'toolkit' too. I've used them before.But we need to know what interference is on the AC line. Graham

Tim Wescott wrote:

> On Thu, 21 May 2009 02:54:36 +0100, Eeyore wrote: > > > I am proposing to engage on a project regarding mains voltage 'purity' > > (and absence of ) with regard to audible clicks and pops in high-end > > professional and hi-fi audio equipment. > > > > Typical EMC filters operate in the RF band and are threfore no use to > > filter audio 'in band' noise that can travel through transformer > > interwinding capacitance etc. > > > > I have found some of the TI INA series that will with suitable > > preconditioning, tolerate mains voltages and give excellent common-mode > > etc rejection. So assembling a 'preamp' front end should be no problem. > > > > What I will need to do however is to filter all the mains frequencies > > and harmonics to a very large degree. > > > > I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I > > have done only a little DSP ( I can't see it happening with analogue > > filters ) and I don't even know where to begin with such a severe filter > > without affecting the pass-band. Same will go for harmonics up to some > > serious number. > > > > Can anyone offer some advice as to algorithms ( number of cycles for > > such a deep notch ) and even better, a readily available eval board upon > > which it could be set up ? Remember I only need to 'hear' audio band, so > > 44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs > > today. > > > > Many thanks, Graham > > This sounds like an adventure into audiophoolery, which isn't what I'd > expect of you.
No it's not. It's come about as a requirement from a real recording studio.
> What, exactly, are you planning on filtering, and what are you planning > on filtering it against?
That's what we need to find out. Where are the clicks and pops getting in. We can't randomly spend the client's cash trying this and that. It needs to be a scientific investigation.
> I suppose that you could filter your power supply rail with a supply that > has infinite rejection at all the power line harmonics -- but it seems > that a good switcher followed by a good linear regulator for clean up > would pound the power-line stuff down by many tens of dB.
The power supply rail is generated inside the console in this case from a balanced AC power feed. NO changes are possible.
> If you absolutely had to get it down further you could incorporate a > resonant element in the feedback of the linear regulator, arranged to > provide a good notch. Doing this with a DSP may just make sense in that > case.
I want the DSP to analyse what's going into the console PSU so I can see what needs to be addressed and where.
> Filtering anything else sounds like flat-out magic.
Fine, come round to S. London and listen for yourself.
> And finally, if it's clicks and pops you're trying to eliminate, that > would seem to indicate a problem with transients on the line, which > aren't things that you're going to notch out.
Yes it does seem to be audio in band transients and my colleague and I have several ideas how it's getting into the audio and have already explored in some depth but we need more specialist tools to find the exact path. Graham

Nico Coesel wrote:

> Eeyore <rabbitsfriendsandrelations@hotmail.com> wrote: > > >I am proposing to engage on a project regarding mains voltage 'purity' > >(and absence of ) with regard to audible clicks and pops in high-end > >professional and hi-fi audio equipment. > > > >Typical EMC filters operate in the RF band and are threfore no use to > >filter audio 'in band' noise that can travel through transformer > >interwinding capacitance etc. > > > >I have found some of the TI INA series that will with suitable > >preconditioning, tolerate mains voltages and give excellent common-mode > >etc rejection. So assembling a 'preamp' front end should be no problem. > > > >What I will need to do however is to filter all the mains frequencies > >and harmonics to a very large degree. > > > >I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I > >have done only a little DSP ( I can't see it happening with analogue > >filters ) and I don't even know where to begin with such a severe filter > >without affecting the pass-band. Same will go for harmonics up to some > >serious number. > > > >Can anyone offer some advice as to algorithms ( number of cycles for > >such a deep notch ) and even better, a readily available eval board upon > >which it could be set up ? Remember I only need to 'hear' audio band, so > >44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs > >today. > > A sharp filter for just one frequency is very easy. One ore more > biquad sections (5 multiplies & adds per biquad) are sufficient. That > doesn't take a lot of processing power. A cheap & simple ARM > microcontroller will do. > > Still, you should be aware of phase changes near the filter > frequencies.
Of course.
> I'm quite sure this will alter the sound.
I'm not interested in the 'sound' of the mains other than to see disturbances on it in the audio band.
> However I have to go along with Tim. Filtering 50Hz harmonics is not > going to help. The plops and clicks you mention are not a multiples of > 50Hz.
That's why I want to eliminate the 50 , 100 , 150 Hz etc so I can see what they ARE.
> These are just random spikes on the mains. If these spikes end > up in your audio circuitry, then you most likely have a ground loop or > another ground related problem somewhere. It means that the current > from the spike shares a return path with your audio signal.
Trust me, my colleague and I know all about ground loops, technical earths etc and have even completely Faraday caged several studios. I do not believe it has anything to do with grounds on the basis of what I've seen. What I'd really like to know is just where I can find info on doing what I wanted to do, i.e. perform sharp notch filters with a narrowish bandwidth. I do know what I'm doing in terms of trying to analyse the problem, I just need some help with the DSP. Graham
On a sunny day (Thu, 21 May 2009 02:54:36 +0100) it happened Eeyore
<rabbitsfriendsandrelations@hotmail.com> wrote in
<4A14B45B.7CDCFC35@hotmail.com>:

>I am proposing to engage on a project regarding mains voltage 'purity' >(and absence of ) with regard to audible clicks and pops in high-end >professional and hi-fi audio equipment. > >Typical EMC filters operate in the RF band and are threfore no use to >filter audio 'in band' noise that can travel through transformer >interwinding capacitance etc. > >I have found some of the TI INA series that will with suitable >preconditioning, tolerate mains voltages and give excellent common-mode >etc rejection. So assembling a 'preamp' front end should be no problem. > >What I will need to do however is to filter all the mains frequencies >and harmonics to a very large degree. > >I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I >have done only a little DSP ( I can't see it happening with analogue >filters ) and I don't even know where to begin with such a severe filter >without affecting the pass-band. Same will go for harmonics up to some >serious number. > >Can anyone offer some advice as to algorithms ( number of cycles for >such a deep notch ) and even better, a readily available eval board upon >which it could be set up ? Remember I only need to 'hear' audio band, so >44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs >today. > >Many thanks, Graham
Dear Rabit: http://panteltje.com/panteltje/xpequ/humfilter-0.1.tgz Actually it is just an interface I wrote to the code of somebody else, the original was at http://www.abelian.demon.co.uk/humfilt/ but no longer seems to respond... It is pretty good rejection, but does affect the sound. C code, of coure.
Eeyore wrote:
> > Nico Coesel wrote: > >> Eeyore <rabbitsfriendsandrelations@hotmail.com> wrote: >> >>> I am proposing to engage on a project regarding mains voltage 'purity' >>> (and absence of ) with regard to audible clicks and pops in high-end >>> professional and hi-fi audio equipment. >>> >>> Typical EMC filters operate in the RF band and are threfore no use to >>> filter audio 'in band' noise that can travel through transformer >>> interwinding capacitance etc. >>> >>> I have found some of the TI INA series that will with suitable >>> preconditioning, tolerate mains voltages and give excellent common-mode >>> etc rejection. So assembling a 'preamp' front end should be no problem. >>> >>> What I will need to do however is to filter all the mains frequencies >>> and harmonics to a very large degree. >>> >>> I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I >>> have done only a little DSP ( I can't see it happening with analogue >>> filters ) and I don't even know where to begin with such a severe filter >>> without affecting the pass-band. Same will go for harmonics up to some >>> serious number. >>> >>> Can anyone offer some advice as to algorithms ( number of cycles for >>> such a deep notch ) and even better, a readily available eval board upon >>> which it could be set up ? Remember I only need to 'hear' audio band, so >>> 44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs >>> today. >> A sharp filter for just one frequency is very easy. One ore more >> biquad sections (5 multiplies & adds per biquad) are sufficient. That >> doesn't take a lot of processing power. A cheap & simple ARM >> microcontroller will do. >> >> Still, you should be aware of phase changes near the filter >> frequencies. > > Of course. > >> I'm quite sure this will alter the sound. > > I'm not interested in the 'sound' of the mains other than to see disturbances > on it in the audio band.
Why not null out the 50 & 100 Hz components roughly with an analogue filter and then look at the rest of them. Chances are at least some of the clicks and pops are coming from zero crossing lamp controllers, CFL and other switch mode loads. Fridges, oil boiler and aircon motors seem to have the nastiest startup transients.
> > >> However I have to go along with Tim. Filtering 50Hz harmonics is not >> going to help. The plops and clicks you mention are not a multiples of >> 50Hz. > > That's why I want to eliminate the 50 , 100 , 150 Hz etc so I can see what > they ARE.
It might be easier to grab long chunks of the waveform with the 50 & 100 Hz components only crudely nulled out and then use an FFT mask IFT type post processing solution to remove your remaining unwanted fundamentals. You only need to save the buffer when a click is heard. Something that is sharp in the time domain will be extended and spread out in the frequency domain. Clicks and pops should still be visible in the FFT even with some uncancelled fundamental. I'd be more inclined to monitor the buildings 3 phase mains input power in realtime and look for contemporaneous sudden changes in the reported power usage just after a spike/pop/glitch is heard.
> >> These are just random spikes on the mains. If these spikes end >> up in your audio circuitry, then you most likely have a ground loop or >> another ground related problem somewhere. It means that the current >> from the spike shares a return path with your audio signal. > > Trust me, my colleague and I know all about ground loops, technical earths > etc and have even completely Faraday caged several studios. > > I do not believe it has anything to do with grounds on the basis of what I've > seen. > > What I'd really like to know is just where I can find info on doing what I > wanted to do, i.e. perform sharp notch filters with a narrowish bandwidth. I > do know what I'm doing in terms of trying to analyse the problem, I just need > some help with the DSP.
I presume you have already tried copper/mu-metal/copper sheets above and below to prevent ingress of stray magnetic fields. Regards, Martin Brown
"Eeyore" <rabbitsfriendsandrelations@hotmail.com> wrote in message 
news:4A14B45B.7CDCFC35@hotmail.com...
>I am proposing to engage on a project regarding mains voltage 'purity' > (and absence of ) with regard to audible clicks and pops in high-end > professional and hi-fi audio equipment. > > Typical EMC filters operate in the RF band and are threfore no use to > filter audio 'in band' noise that can travel through transformer > interwinding capacitance etc. > > I have found some of the TI INA series that will with suitable > preconditioning, tolerate mains voltages and give excellent common-mode > etc rejection. So assembling a 'preamp' front end should be no problem. > > What I will need to do however is to filter all the mains frequencies > and harmonics to a very large degree. > > I imagine I would need for example to null 50 Hz +/- 2 Hz to ~ -100dB. I > have done only a little DSP ( I can't see it happening with analogue > filters ) and I don't even know where to begin with such a severe filter > without affecting the pass-band. Same will go for harmonics up to some > serious number. > > Can anyone offer some advice as to algorithms ( number of cycles for > such a deep notch ) and even better, a readily available eval board upon > which it could be set up ? Remember I only need to 'hear' audio band, so > 44.1 or 48 kHz sampling should be OK esp given the oversampling ADCs > today. > > Many thanks, Graham
Wouldn't it be easer to get a Digital CRO that can record/digitize the AC waveform --> Tranfer the data to a PC and post process Cro or FFT the waveform Joe