Go Down

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

#### reva23

##### Oct 27, 2020, 12:21 pm
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.

#### TheMemberFormerlyKnownAsAWOL

#1
##### Oct 27, 2020, 12:33 pmLast 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?

Please don't PM technical questions - post them on the forum, then everyone benefits/suffers equally

#### Grumpy_Mike

#2
##### Oct 27, 2020, 12:34 pm
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

#3
##### Oct 27, 2020, 03:06 pm
Or, just make your software ignore the 0Hz bin.

#### raschemmel

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

"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

#5
##### Nov 04, 2020, 08:02 am
Code: [Select]
` for(int i=0; i<(SAMPLES/2); i++)`
change i to 1 or 2,3 , 5 ......

#### 6v6gt

#6
##### Nov 04, 2020, 10:10 am
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

#7
##### Nov 11, 2020, 04:28 am
Maybe you can set the component for the FFT result at 0 Hz to be zero. And then IFFT.

Go Up