Go Down

Topic: DC offset removal from analog signal (Read 357 times) previous topic - next topic

reva23

Hi all,


I'm applying analog signal of 60Hz frequency, 2.0Vp-p with 1.0vdc offset using function generator to the arduino analog pin. Im trying to plot FFT for the input signal but my FFT peak is at 0Hz. How can I remove the DC offset from signal in code itself.

Any guidance would be great.

Thanks in advance.

TheMemberFormerlyKnownAsAWOL

#1
Oct 27, 2020, 12:33 pm Last Edit: Oct 27, 2020, 12:37 pm by TheMemberFormerlyKnownAsAWOL
Quote
How can I remove the DC offset from signal in code itself.
Using the subtract operator?

(And please stop just dumping your questions in "Installation and troubleshooting")
Please don't PM technical questions - post them on the forum, then everyone benefits/suffers equally

Grumpy_Mike

Quote
How can I remove the DC offset from signal in code itself.
Apply just the offset with no signal on it. Take a measurement, then when sampling simply subtract that measurement from the readings you take.

DVDdoug

Or, just make your software ignore the 0Hz bin.

raschemmel

#4
Oct 27, 2020, 03:32 pm Last Edit: Oct 27, 2020, 03:35 pm by raschemmel
@AWOL,
Are you still AWOL ? :D

"I'm sorry Dave, I can't do that..."
Quote
How can I remove the DC offset from signal in code itself.
The brute force approach is an op amp subtractor, but the other suggestions sound like alot less work.

Vik321

Code: [Select]
 for(int i=0; i<(SAMPLES/2); i++)
change i to 1 or 2,3 , 5 ......

6v6gt

A 1 volt DC offset with a 10bit ADC with a 5 volt voltage reference (e.g. Arduino Uno in standard configuration) implies a shift of 205 analog units.
What sampling frequency are you using ?

Southpark

Maybe you can set the component for the FFT result at 0 Hz to be zero. And then IFFT.

Go Up