Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm producing a signal which contains 7 frequencies using a microcontroller with a DAC. the frequencies are 16.5kHz 16.7kHz 16.9kHz 17.2kHz 17.4kHz 17.6kHz 17.8kHz. and sampling frequency (at the output) is 86kHz. The signal from the mc is at is then decreased by two resistors (600R/2600R)and fed into LM-386 (which increases the signal by 20) and then into a 4ohm Speaker.

Because of the generation method I get harmonics, aliasing and some parasitic low frequency of which I wish to get rid off. I've calculated that for RC-LPF with Fc=20kHz I need 220nF and 34ohm however, when I put them just before the the (600R/2600R) resistors the whole signal seems to be attenuated significantly!

Am I doing something wrong here? Thanks for the help!

EDIT: The microcontroller is pic16F1783

here's the schematic: enter image description here

share|improve this question
    
A schematic would be very helpful in understanding your problem. –  Phil Frost Jan 14 '13 at 19:40
    
Why are you attenuating the signal before op amp? You could just reduce op amp gain if needed. I'd put filter after op amp since op amp provides low impedance output. It would be helpful if you put a schematic and gave information about your microcontroller. –  Gustavo Litovsky Jan 14 '13 at 19:41
    
Are you using single or dual supply configuration? if it single supply, those resistors I would assume might help being the reference point, so you might have a wrong circuit. Schematic would definitively help. –  Gustavo Litovsky Jan 14 '13 at 19:43
    
It sounds like you have problems in your synthesis software. Fixing those should make your output clean within the nyquist bandwidth, requiring only a low pass filter for anti-aliasing. –  Chris Stratton Jan 14 '13 at 21:17
    
In effect, you are trying a crude workaround for the DDS implementation problems raised, but apparently not yet fixed, in your previous question electronics.stackexchange.com/questions/53567/frequency-shift –  Chris Stratton Jan 14 '13 at 21:25

1 Answer 1

up vote 5 down vote accepted

The PICs DAC peripheral has a very low drive capability (read high output impedance) so it needs to be buffered. The datasheet gives an example:

DAC Buffer

If you add your RC filter directly after the DAC, the impedance of he DAC will add to the R in the RC filter and lower the bandwidth. So implement the buffer and then put the filter afterwards (or you can make the filter part of the gain opamp)

To filter the opamp with the gain of 20, you can add a capacitor across the feedback resistor something like ths:

Opamp Filter

Here's a couple of references on opamp filters:

Basic reference
Opamps for Everyone - not just filters, but an excellent overall free book on opamps, well worth having handy.

share|improve this answer
    
@Daniel - I think I have jumped the gun here, I initially though the filter was after the divider (sorry). I see the DAC is built into the PIC, just checking now... –  Oli Glaser Jan 14 '13 at 20:28
    
I've looked at the PIC's datasheet, ww1.microchip.com/downloads/en/DeviceDoc/41579D.pdf on page 170 which describes the DAC, it says nothing about the output impedance... –  Daniel Jan 14 '13 at 20:31
    
No, it's not the best documentation, but on pg.169 last paragraph it says the DAC needs buffering due to limited drive capability. So add the simple opamp buffer shown and your filter afterwards. You need to have a knwon impedaance source to drive your filter from (or as mentioned it can be made part of the opamp by placing a capacitor across the feedback resistor - if you want I can add an example of this also) –  Oli Glaser Jan 14 '13 at 20:42
    
Thanks. Could you please explaining what you mean by "lower the bandwidth?" which bandwidth? If it's no trouble, I'd love to learn how to place a capacitor across the feedback resistor. thank you very much! –  Daniel Jan 14 '13 at 20:48
2  
Yes, that's what I meant. I think it's actually better just to put the filter after your buffer (since it simplifies things for a single supply circuit) I'll add a couple of references that go into some detail on the subject of opamp filters though. –  Oli Glaser Jan 14 '13 at 21:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.