Getting rid of the 16kHz pwm noise.

504 views
Skip to first unread message

Kai Fox

unread,
Oct 11, 2013, 9:08:23 AM10/11/13
to mozzi...@googlegroups.com
I am quite new to Mozzi (and Arduino in general), so if this is just a stupid error by me, don't be too surprised.

When using Mozzi, there is an extremely high-pitched squealing noise. Applying a low pass filter does absolutely nothing, so it seems like my Oscil is not doing anything wrong, more that its some distortion of the output. I can't say for sure, but I believe that the sound is generated by the pule width modulation Mozzi uses to produce sound waves.

I was just about to give up on Mozzi, when I saw the example Sinewave_HIFI, I checked it out and saw that, in a comment, the example mentioned removing a 16kHz pwm noise. I knew this was the answer, but when I tried it out. The sound was grungy and distorted, which was not acceptable.

Could I be missing something in making my sound HIFI, or am I going down the wrong track by making the output HIFI?

Tim Barrass

unread,
Oct 11, 2013, 10:11:26 AM10/11/13
to mozzi...@googlegroups.com
Hi Kai,
this keeps coming up!  Actually, more of an explanation is hidden in the bike computer post just before this one... I'm working on a better audio out solution, but I'm snowed under with other stuff for a while yet.

Did you see the notes in the Sinewave_HIFI sketch about changing Mozzi/mozzi_config.h?

    AUDIO_MODE has to be changed from STANDARD mode to HIFI.
    In Mozz/mozzi_config.h, change
    #define AUDIO_MODE STANDARD
    //#define AUDIO_MODE HIFI
    to
    //#define AUDIO_MODE STANDARD
    #define AUDIO_MODE HIFI

ie. swap the comments.

And you've got the output circuit with 2 resistors and a capacitor described in the sketch?

Also, just curious, are you saying that you put the output through the external RC lowpass filter described on the mozzi page http://sensorium.github.io/Mozzi/learn/output/ and nothing happened?  Strange....then again, you might have great high frequency hearing... you can add more of those circuits in series for more reduction of the high frequencies...

Tim


--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To post to this group, send an email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/17df9d87-32b7-42c5-992d-c5c0daa264ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages