# [PD] dac object question

Lex Ein lex_ein at f-m.fm
Fri Jul 9 02:47:24 CEST 2004

```Frank Barknecht wrote:

>Hallo,
>
>first: thanks a lot for explaining the DC effects to you and to Lex. I
>did however ask my question slightly ambivalent. I also would be interested
>in why and how a [hip~ 5] filter removes a DC offset.
>
>
It's convenient to look at DSP in the time domain to answer this.

A factory worker (a signal processor) is tasked to:
- grab an audio sample (a card with a number) off a conveyor belt
at the sample rate (as fast as they're delivered),
- perform simple arithmetic,
- erase and write the answer on the card,
- drop the card on the output conveyor belt.
The worker only thinks about the current number and
the last number before it was crossed out..
Numbers range in value from -1 to +1.

In a two-sample crude lowpass:
Sout = (Sample1 + Sample0)/2
This sums current (Sample1) and previous (Sample0) input samples
and divides by 2 (otherwise this filter would have a gain of 2).
This preserves DC because any two adjacent identical samples are output
without alteration.

Sout = (Sample1 - Sample0)/2
( We still divide by 2 because 1 -(-1) gives a peak amplitude of 2.)
cancel each other out, so only changing signals make it out.  The more
rapidly the signal changes, the more amplitude it will have. This creates
a high pass filter. DC is effectively removed, or more accurately,
restored to 0.

Questions for the reader, and MOVING THIS DISCUSSION TO PD-OT,
These examples make for weird filters. In the real world, nobody makes
filters this simplistically. For example: frequencies at half the sample
rate are nulled.
- Why?
- What happens to frequencies above 1/2 the sample rate?
- Ooh, that's bad, isn't it?
- Can you get rid of DC by performing a forward FFT, then an inverse FFT?
- Why does _that_ work?
- Is it a good idea?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DC.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20040708/365f8030/attachment.asc>
```