# remove 60 Hz noise

Started by October 5, 2006
```Hi everybody i'm newbie in DSP,

I'm writing an application in Java.
My application does the following: Trace an ECG diagram, diagram is
represented by an array of 2000 values, the signal duration is 4 secs,
it's mean 500 points/second, so my frequency is 500Hz.

Now my application must remove 60 Hz noise from diagram using notch
filter.

I dodn't know how to process exactely, but if i understood:

W0 = 2*pi*f0/fs
where  f0 = 60Hz and fs = 500Hz

So if the sampling frequency is 500 Hz, the zero at +43,2&#2013266096; will completely
eliminate any signal at 60 Hz, is it correct?

I got +43,2&#2013266096; from this 2*pi*f0/fs  where pi is in degres(180)

```
```Yes, this is correct.  You may have to watch where you put the zeros of
the digital filter, basically you want a zero at z0=3De^+/-j(0.24*pi)
where 0.24 comes from 60/250 because 250Hz is your Fs/2.  This gives an
FIR filter at 60Hz given by

h =3D z^2 + z 2*Real(-z0) + 1

or an FIR filter with coefficients b0 =3D 1, b1 =3D 2*Real(-z0), b2 =3D 1

hope that helps.

col

zorgz wrote:
> Hi everybody i'm newbie in DSP,
>
> I'm writing an application in Java.
> My application does the following: Trace an ECG diagram, diagram is
> represented by an array of 2000 values, the signal duration is 4 secs,
> it's mean 500 points/second, so my frequency is 500Hz.
>
> Now my application must remove 60 Hz noise from diagram using notch
> filter.
>
> I dodn't know how to process exactely, but if i understood:
>
> W0 =3D 2*pi*f0/fs
> where  f0 =3D 60Hz and fs =3D 500Hz
>
> So if the sampling frequency is 500 Hz, the zero at +43,2=B0 will complet=
ely
> eliminate any signal at 60 Hz, is it correct?
>=20
> I got +43,2=B0 from this 2*pi*f0/fs  where pi is in degres(180)

```
```You may want to plot the response of this. It gives high-frequency
emphasis that you may not want, and you may not like how it shapes the
spectrum in general.

Dirk Bell
DSP Consultant

cb135@hotmail.com wrote:
> Yes, this is correct.  You may have to watch where you put the zeros of
> the digital filter, basically you want a zero at z0=3De^+/-j(0.24*pi)
> where 0.24 comes from 60/250 because 250Hz is your Fs/2.  This gives an
> FIR filter at 60Hz given by
>
> h =3D z^2 + z 2*Real(-z0) + 1
>
> or an FIR filter with coefficients b0 =3D 1, b1 =3D 2*Real(-z0), b2 =3D 1
>
> hope that helps.
>
> col
>
>
> zorgz wrote:
> > Hi everybody i'm newbie in DSP,
> >
> > I'm writing an application in Java.
> > My application does the following: Trace an ECG diagram, diagram is
> > represented by an array of 2000 values, the signal duration is 4 secs,
> > it's mean 500 points/second, so my frequency is 500Hz.
> >
> > Now my application must remove 60 Hz noise from diagram using notch
> > filter.
> >
> > I dodn't know how to process exactely, but if i understood:
> >
> > W0 =3D 2*pi*f0/fs
> > where  f0 =3D 60Hz and fs =3D 500Hz
> >
> > So if the sampling frequency is 500 Hz, the zero at +43,2=B0 will compl=
etely
> > eliminate any signal at 60 Hz, is it correct?
> >=20
> > I got +43,2=B0 from this 2*pi*f0/fs  where pi is in degres(180)

```
```"zorgz" <zorgz@mail.ru> wrote in message
news:tpGdnTwg8J7fjrjYnZ2dnUVZ_sGdnZ2d@giganews.com...
> Hi everybody i'm newbie in DSP,
>
> I'm writing an application in Java.
> My application does the following: Trace an ECG diagram, diagram is
> represented by an array of 2000 values, the signal duration is 4 secs,
> it's mean 500 points/second, so my frequency is 500Hz.
>
> Now my application must remove 60 Hz noise from diagram using notch
> filter.
>
> I dodn't know how to process exactely, but if i understood:
>
> W0 = 2*pi*f0/fs
> where  f0 = 60Hz and fs = 500Hz
>
> So if the sampling frequency is 500 Hz, the zero at +43,2&#2013266096; will completely
> eliminate any signal at 60 Hz, is it correct?
>
> I got +43,2&#2013266096; from this 2*pi*f0/fs  where pi is in degres(180)
>
>

H(z)= 1-z^-N/(1-(z/alpha)^-N) where mag (alpha)<1

This is a notch filter. You need to work out N for your sampling freq and
alpha = 0.9 say.
This will also notch out dc too.

M.

--
Posted via a free Usenet account from http://www.teranews.com

```
```Major Misunderstanding wrote:
<clipped>
> H(z)= 1-z^-N/(1-(z/alpha)^-N) where mag (alpha)<1

Do you mean:  H(z)= (1-z^-N)/(1-(z/alpha)^-N) where mag (alpha)<1  ?

Takes out the harmonics too!

Dirk

>
> This is a notch filter. You need to work out N for your sampling freq and
> alpha = 0.9 say.
> This will also notch out dc too.
>
>
> M.
>
>
>
> --
> Posted via a free Usenet account from http://www.teranews.com

```