![]() | ![]() | ![]() |
| | |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I was recently trying to get an AVR play music. I successfully managed to get the AVR playing 3 octaves from about 130Hz to about 2KHz. However, the output from the AVR is a square wave, which results in a vary harsh sound from the speaker. I was using the LM380 Power amplifier. There was a strange thing that I noticed. The power amplifier gave sound output when the input voltage was below 20mV p-p. However, there was no sound output when the input voltage was increased. Then Again there was some sound heard when the input was directly fed from the AVR (0-5v) to the LM380. How do I get a lower distortion sound from the AVR? Please Help... :-(
__________________ Bharath Bhushan Lohray. M.Sc. Electronics. | |
| |
| | (permalink) | |
| Quote:
You might consider using a digital to analogue converter?, and outputing sinewaves instead of square, but you still need a low pass filter anyway. | ||
| |
| | (permalink) |
| If you're just using squarewaves then you don't need an audio amplifier, a simple complementary pair of MOSFETs acting as a push pull buffer will be far more efficient, add a simple low-pass filter and you have a little class-D amplifier.
__________________ I also post at the following sites: http://www.stop-microsoft.org http://www.heated-debates.com Screen name: Aloone_Jonez And http://www.silicontronics.com, same screen name as here. | |
| |
| | (permalink) |
| If you don't like distortion then don't play square-waves. A square-wave with the same p-p amplitude as a sine-wave has twice the power of the sine-wave. So the harmonics of a square-wave have the same amount of power as the fundamental sine-wave of the square-wave.
__________________ Uncle $crooge | |
| |
| | (permalink) |
| Use hardware PWM for audio on an AVR. The higher the PWM frequency the better. Using a tiny15 you can use it's high speed PWM to generate a 100khz square wave at 8 bits resolution for the duty cycle, passing the output through a lowpass filter with a cutoff frequency of about 20khz will give you moderatly acceptable output. Using a scheme like this you'll likley be able to get a 'clean' signal at 1/8 to 1/16th of the driving frequency (100khz) So for a 100khz PWM signal you're not going to get a clean output much above about 5khz.. That's at the upper limits of what an AVR can do. | |
| |
| | (permalink) |
| The LM380 seems to have a fixed voltage gain of 50. Chances are that when you drive the chip directly it's going into some weird nonlinear/saturation. If you were to scope out the waveforms, they probably wouldn't make too much sense. A small D-A converter is probably the best bet. That with DDS (google it) will probably give you some reasonable results. | |
| |
| | (permalink) |
| Years ago I heard 8-bit long distance telephone calls. The quality with voice was horrible. I don't want to think about music like that.
__________________ Uncle $crooge | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| 8 bits isn't good enough for really hi fidelity music, but only because the dynamic range isn't very good. It's fine for simple waveforms. ulaw encoding can increase the dynamic range but it's not as good as increasing the number of bits. The music you're going to get out of an AVR is never going to be much better than clicks and beeps. It's possible to do simple polyphonic music but the quality will never really be very good. | |
| |
| | (permalink) |
| It's easy to hear what 8-bit is like just by convering an audio file on your PC to 8bit 44.1khz stereo wav. I expect with a lot of modern, extremely compressed music, it wouldn't even be that evident!
__________________ Angry!? I'm absolutely electrolytic! Will have to make do with myspace now I guess... | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Old Distortion Analyzer and Audio Analzyer | walters | General Electronics Chat | 50 | 28th January 2006 02:17 AM |
| Connection of Siemens c167 microcontroller to peripherals. | Roslan | Electronic Projects Design/Ideas/Reviews | 3 | 23rd March 2004 07:52 PM |
| The ultimate distortion measurements | Vladimir_K | Electronic Projects Design/Ideas/Reviews | 0 | 29th February 2004 05:03 PM |