![]() |
Forum Index : Microcontroller and PC projects : Improved filter for WAV file playback....
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9644 |
Hi all. ![]() I found these very interesting images and schematic for an RLC low-pass-filter on the web tonight: ![]() ![]() ![]() All these screenshots are captured from this website. What I like about this one, is that it's output waveform seems very respectable vs input PWM signal, and as it was designed to work with the 8-bit Arduino PWM output, this should jive perfectly with the 8-bit PWM output from the MM+ and it's new WAV playback feature. Do any of the members have any thoughts or comments on this? EDIT: For those who want to read about the mathematics of this filter, you can find out about it here. Smoke makes things work. When the smoke gets out, it stops! |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10406 |
![]() This is the waveform I get with the existing single pole filter - 500Hz sine wave The MM+ and 200MHZ MZ use a 80KHz PWM rather than the 32KHz used in the Arduino example. The 252MHz MZ uses 96KHz The filter above is set too low as the WAV output can cater for 16Khz input sample rates on the MM+ and 200MHz MZ. The 252MHz MZ can also use inputs with 48MHz sample rates. There is no doubt the Chebyshef would do a better job but this is probably a case of diminishing returns |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9644 |
Hi there. ![]() That CRO shot of the actual MM+ output is excellent - that works for me. ![]() Is this with the filter on page 23 of the advanced manual? 2x 2k, 47nF and 1k per channel. Chebyshef filter idea aborted. As I did not see that waveform on the output of the MM+ until you posted the photo above, I was not aware it was actually THAT clean, so we'll just ignore this thread now. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10406 |
The filter in Geoff's circuit is just 1K into 47nF. The rest is a potential divider. The picture was actually taken from the output of the LM386 on my 100-pin MZ board. The biggest issue with sound is making sure the input and outputs from the amp aren't clipping. In my case the amp is fed with 5V and has a 20x gain so I need to make sure the input signal is something less than 250mV. I'm using 4K7 and 270R to do this. I'm also AC coupling Geoff's circuit to the input of the amp using a 0.47uF polyester capacitor |
||||
Cremo Newbie ![]() Joined: 21/07/2015 Location: ItalyPosts: 36 |
I need help: I did some tests with PLAY WAV and I obtained very bad results. At 1Khz i measured a distortion of about 5%. Maybe the file I prepared was not correct. I would like to know if someone measured values like the ones obtained with Arduino (50dB that is a distortion of about 0.3%). Maybe my file is not correct ? Thank you. Pietro |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10406 |
If you created a file with 8KHz sampling rate then you only have 8 samples per waveform so 5% seems about right. The PLAY TONE command with a 1Khz output has 80 samples per waveform. A 16hz wav file would be better but still not great The MZ at 252MHz can output 48 samples per 1KHz waveform at 1KHz from a WAV file |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9644 |
So, does that mean that with 16kHz samples, the distortion should be in the area of 2.5% then? Just curious..... Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |