Best hardware for output quality?

369 views
Skip to first unread message

James Field

unread,
Oct 31, 2015, 8:23:11 AM10/31/15
to Mozzi-users
Hi guys,

I'm a total noob to Arduino. Most I've done is load existing sketches and tweak a few parameters here and there. Am currently balls deep in reading 'C for Arduino' by Jack Purdam. I am an electronics tinkerer/ hobbyist and a professional Sound Designer.

Basically I found Mozzi because I want to make a little AA battery powered test signal generator that I can just throw in my toolbox and plug in when needed.

I would ideally need to be able to sweep a sin manually from 20Hz - 20kHz with a pot that controls frequency, and produce pink noise with the same pot switching to the cutoff of a 24dB per octave HPF.

So, my initial questions are as follows:

  • Is a 20kHz oscillator frequency possible, or does it top out at 16.384kHz?
  • Would I be using a wavetable for the pink noise, or can it be generated with math on the fly?
  • What is currently the best hardware with regards to signal to noise, frequency response, etc (I have a couple of Arduinos lying around and just ordered a couple of Teensy 3.1)?
  • Has anybody ever had a display working with Mozzi? I would love to be able to have a readout of the frequency being output. I understand that this would put a lot of load on the micro, but my application is just a monophonic output with one filter. Possible?
Pretty sure I'm going to have more questions, but that's it for now.

Thanks in advance :)

Tim Barrass

unread,
Nov 1, 2015, 12:41:21 AM11/1/15
to mozzi...@googlegroups.com
Hi James,

>Is a 20kHz oscillator frequency possible, or does it top out at 16.384kHz?
Mozzi tops at 16.384kHz.  Have you looked at the Teensy audio library?  It might do better, if you're just playing simple waveforms.


>Would I be using a wavetable for the pink noise, or can it be generated with math on the fly?
Mozzi is set up to use a wavetable, you'd have to explore algorithms to generate pink noise on the fly.  Another approach is to use a table but offset to a different random location in it occasionally to avoid obvious repetition.


>What is currently the best hardware with regards to signal to noise, frequency response, etc (I have a couple of Arduinos lying around and just ordered a couple of Teensy 3.1)?
Teensy 3.1 is good because it has a DAC, so avoids artifacts from PWM, which Mozzi uses on older Atmel-based arduino boards.  The Teensy 3.1 DAC has 12 bit audio depth where you can have 14 bits depth in HIFI mode on the boards with PWM output.  I'd probably go for the Teensy.


>Has anybody ever had a display working with Mozzi? I would love to be able to have a readout of the frequency being output. I understand that this would put a lot of load on the micro, but my application is just a monophonic output with one filter. Possible?
Someone else might know this one....

Good luck,
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 email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/21c98241-d38d-4858-b56b-00361ac6719b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Field

unread,
Nov 1, 2015, 3:30:27 PM11/1/15
to Mozzi-users
Hey Tim.

Thanks for taking the time to give those answers. I like your creative suggestion regarding the pink noise. I think I'll just go ahead and build Mozzi on a Teensy, live with the frequency limitation, and treat it as a learning experience.

I would have very little idea at this point on how to start something from scratch using the Teensy Audio Library. Seems like a fun project anyways :)

PaulStoffregen

unread,
Nov 18, 2015, 7:23:25 AM11/18/15
to Mozzi-users

The very best would be this large, complex, expensive and still-in-testing board.

https://hackaday.io/project/5912-teensy-super-audio-board

One issue you're going to run into is 44 kHz sampling can represent up to 22 kHz, but no output can implement a perfect "brick wall" low pass filter at exactly 22.05 kHz.  If there's no oversampling and no filtering, as with the 12 bit DAC pin, you'll end up with something that looks like a terrible square wave.  A perfect filter would turn it into the intended sine wave, but such perfect filters don't exist.

Really high-end DACs, like the one on William's Super Audio Board use 8X oversampling with digital filtering.  So if the sample rate is 44.1 kHz, internally the DAC creates 352.8 kHz data with a very good digital filter near 20 kHz.  Then you get a stairstep waveform, where the little steps are in the 350 kHz range.  Often those chips have a first or second order analog low-pass filter on the chip, and you implement another one on your PCB (usually involving an expensive opamp and high quality capacitors).  The result is extremely good output, but at quite a cost.

The normal Teensy Audio Shield with SGTL5000 codec chip has some oversampling, but not nearly the perfect filtering.  If you follow its output with an opamp-based 2nd or 4th order filter, you'll probably get a pretty nice output.

Of course, if you're not an audiophile or trying to use the sine wave for anything other than listening, you can just run the output to headphones.  They don't have any response at such high frequencies, so the presence of extra ultrasonic switching doesn't matter.

But if you're trying to make some sort of high quality instrumentation that generates a pure sine wave without extra ultasonic frequencies, you're going to need a much better circuit.



James Field

unread,
Nov 18, 2015, 7:16:13 PM11/18/15
to Mozzi-users
Hi Paul.

Thanks for that link. Very cool indeed.

No need for any "brick wall" digital filters for my use case, as the equipment I'd be using the sig gen with has this all built in at the input stage. As an aside, I've never come across a true brick wall LPF. In my experience there is always some kind of slope there.

I'm just messing around with this as a side project at the moment. I may actually be better off just using the teensy library without Mozzi for such a simple project, I'm thinking at this stage.

At the moment I'm lugging around a notebook with a measurement grade USB interface and often I only use it to produce tones and noise. Would be nice to have a zippy box sized device to whip out when needed :)
Reply all
Reply to author
Forward
0 new messages