# AD9833 through a bandpass filter - what happens ?

Status
Not open for further replies.

#### 8dm7bz

Joined Jul 21, 2020
199
Hello,
I wondered about what would happen if I feed a 20KHz square wave, that goes from 0V to 5V, through a bandpass filter. Does it filter out the DC part and the only part that's left is a square wave oscillating from -2.5V to 2.5V ? And if that's the case, where does the "negative" voltage come from ?

#### ericgibbs

Joined Jan 29, 2010
14,171

#### 8dm7bz

Joined Jul 21, 2020
199
@ericgibbs thanks for suggesting that, very informative. I understand now that square waves are just a combination of the right sine waves. But I feel like that doesn't answer my question.
I guess the question now becomes: "What happens when I output a 20KHz sine wave with the AD9833, and feed that through a bandpass filter ?"

The problem I have is that the AD9833 has a DAC, which produces only voltages above 0V. But that sine wave looks just like an AC sine wave with some DC offset.
Does the DAC output from the AD9833 through a bandpass filter cut out the "possible DC offset" and go below 0V ?

thanks,
8dm7bz

#### ericgibbs

Joined Jan 29, 2010
14,171
hi,
OK, post the specification for the Band Pass filter you are planning.

Why are you defining the OPA type as AD9833.?
E

Is this a typo, initially you said: I output a 20KHz square wave
now: What happens when I output a 20KHz sine wave

#### 8dm7bz

Joined Jul 21, 2020
199
So the op amp I had in mind is this one. With some passive components to achieve the bandpass.
But just now I realise something. Could it be that wether or not negative voltages are produced is dependant on the voltage rails I connect to the op amp. So for example, if I power the op amp with a +5V and a -5V rail, the output wave would become negative ?

thanks,
8dm7bz

#### ericgibbs

Joined Jan 29, 2010
14,171
Hi,
Post a circuit diagram.
E

#### 8dm7bz

Joined Jul 21, 2020
199
Oh, yeah I don't have one. I'm waiting on some opamps to come. I would like to test it myself then. I just wondered what would happen in such a setup.

thanks,
8dm7bz

#### atferrari

Joined Jan 6, 2004
4,471
While you wait, draw a schematic.
The signal generator followed by a filter.

#### ericgibbs

Joined Jan 29, 2010
14,171
hi,
It is important that you post details of the BP filter that you intend to use, in order to give a meaningful reply.
E

#### 8dm7bz

Joined Jul 21, 2020
199
I drew the circuit as I would test it.

And now, what would be the expected output ?

#### 8dm7bz

Joined Jul 21, 2020
199
And then that is the circuit I was talking about in the beginning. The input is a square wave 5Vpp

#### crutschow

Joined Mar 14, 2008
28,194
The input high-pass portion of the filter will block the DC portion of the input, so the output will have a DC average value of zero, thus giving a plus and minus signal.

The low-pass portion of the filter will round off the rising and falling edges of the square-wave, but it will not be a sinewave.

If you want a sinewave from a square-wave, you will need to use a much higher order low-pass filter than the single-pole filter you show.

#### 8dm7bz

Joined Jul 21, 2020
199
Thanks @crutschow I just got my parts and tested it with an oscilloscope. It behaves exactly like you described.

#### DickCappels

Joined Aug 21, 2008
7,973
Agreed with Audioguru Again With an LM358 you would get something more like a trapizoid than a sine.

I'm using a low Q LC filter to clean up the jitter from the 3V P-P square wave out of an AD9833 operating around 60 kHz, to generate a sine wave followed by an LM393 comparator with hysteresis. The filter is intentionally low Q because it needs to be tuned to different frequencies.

It works fine.

Last edited:

#### Ian0

Joined Aug 7, 2020
3,757
If you're thinking of the Whitmire,Patel and Parizi paper, then the filter is specified as having a Q of 15.9. Frequency response is not specified, but it would make no sense for it to be anything other than 100kHz.
Design utility is here http://sim.okawa-denshi.jp/en/OPttool.php
It makes the square-wave into a sine-wave by filtering out the harmonics.
But (see my other post) why bother when you have just generated your square-wave using an IC that can also generate sinewaves?

#### Attachments

• 130.1 KB Views: 2