Go Down

Topic: Harmonic filtering (Read 9816 times) previous topic - next topic

shakki87

I'm using a digital pin to create a 1khz wave. The problem is that its a square wave and it has harmonics. I can hear the harmonic on my radio even in fm band  > 90mhz. I'm trying to use a passive rc low pass filter but it seems it doesn't have any affect. Is  there a way to create a wave that doesn't have harmonics? Either using some filter or by software?

CrossRoads

How are things wired up? Just a bunch of wires on a solderless breadboard? Those wires all act like antennas, so a first step is to clean up wiring.

What is the 1 KHz connected to? A 2nd step might be co-ax or twisted pair wiring to shield the emissions. Ground the shield at one end so you don't induce ground loops.

A 3rd step might be better filtering. Lower the filter frequency, add a 2nd stage of filtering, maybe add active components (op-amps) to make a sharper cutoff band/knee.
http://sim.okawa-denshi.jp/en/CRlowkeisan.htm
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

shakki87

I'm build  small transmitter between a computer and  a portable terminal. I'm using a breadbroard while I'm  testing the transmitter.
The harmonics interfering with the testing. The wirining is from digital and ground to the filter.  co-ax is a good idea but I don't have it now. Won't the wiring still act as antenna after makeing it a circuit? Next have try 2nd stage filtering.


CrossRoads

Yes, but the outer shield of the co-ax will contain a lot of the emissions.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jremington

Try putting some ferrite beads on the wire coming out of the digital pin, as close as possible to the pin. Beads like these will cut RF interference in the short wave and FM bands: http://www.ebay.com/itm/50-pcs-2643250302-FAIR-RITE-43-MATERIAL-SHIELDED-FERRITE-BEAD-25-300MHz-/121152377726?pt=LH_DefaultDomain_0&hash=item1c353e937e

MarkT

#5
Nov 25, 2013, 08:10 pm Last Edit: Nov 25, 2013, 08:11 pm by MarkT Reason: 1

I'm using a digital pin to create a 1khz wave. The problem is that its a square wave and it has harmonics. I can hear the harmonic on my radio even in fm band  > 90mhz. I'm trying to use a passive rc low pass filter but it seems it doesn't have any affect. Is  there a way to create a wave that doesn't have harmonics? Either using some filter or by software?


With a digital pin you have to filter in hardware afterwards.  With high-speed PWM then
a LPF you can get a much better approximation to a sine wave with less critical filtering
requirements.  So a 60kHz PWM through a 2kHz-cutoff LPF will fare much better than
putting a square wave through a single RC filter.

Alternatively you can use a much more performant filter (say 6+ poles) using cascaded
active filter sections, so that it has a steep cutoff just above 1kHz.  However such a
filter is both expensive in components and fixed at a single frequency.

In practice if you want to generate a quality sinusoid you use a DAC and generate
enough samples to greatly reduce the error, then LPF the residual noise away.

[one last possibility: LC resonant filter - however not easy for low frequencies and have the
risk of exceeding the supply voltage at resonance]
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

shakki87

#6
Nov 25, 2013, 10:44 pm Last Edit: Nov 25, 2013, 10:55 pm by shakki87 Reason: 1
Haven't tried the coax cable yet. I tried the 60khz with a 2khz filter but I still get harmonics on radio. 60khz pwm is still a square wave is it not?  And I don't quit understand the idea behind it can you elaborate?

MarkT

Can you clarify what you are doing with the 1kHz signal?  What is this "small transmitter"?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

shakki87

I'm going to use the 1khz as a commucation signal eg morse code, fsk. The transmitter is a simple am transmitter for about 10m for now. If concered about law I dont live in US.

shakki87

#9
Nov 26, 2013, 08:00 pm Last Edit: Nov 26, 2013, 11:43 pm by shakki87 Reason: 1
Tried coax cable didnt't change the situation. Still have expose some of wiring to make a connection.

EDIT: Sees that nothing works to filter harmonic. Is there any way to gererate a signal that has a frequency without harmonic?

CrossRoads

Need to generate with a DAC so you can control the corners more.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

shakki87

Got it working. Insted of using filters I used a 1khz  PHASE-SHIFT OSCILLATOR to create the control signal. Now i only have turn the oscillator on or off. It has some harmonics but now a rc filter works in reducing them. Thanks for the information especially the coax cable.

CrossRoads

Got rounder corners to start then? That makes filtering easier.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

shakki87

Yep. Tried the oscillator on a simulator first almost a perfect sine wave. 

CrossRoads

Have you looked at the output with a real oscilloscope?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up