High frequency upsampler possible on Teensy 4.1?

blueneogeo

New member
Hi,

I would like to use a Teensy 4.1 to create a hifi upsampler using an algorithm I designed and tested on PC. The goal is to get this working in pure hardware, so I can just put the upsampler in the Hifi setup.

My question is if my project is feasible on a Teensy 4.1 board. I require the following specs:

- input via USB audio and I2S if possible (but only USB would be ok for now), at 44.1Khz to 192Khz
- output via I2S to 384KHz or ideally higher (768KHz)
- calculation using 64bit floating point

Is this feasible and if so, what would be a good point to start?

Thank you!
 
Yes, it's possible. You can use the Audio-Lib for input, upsample + filter with CMSIS, and add a modified I2S output. Note for the Audio-Lib you'll need an additional input or output which provides the timing for usb.

BUT an ... upsampling, no, _any_ processing will not increase the soundquality. That is impossible. So, what is the intention?
 
What bit depth are you assuming? Why double floats if only sampling 16 bits (the Audio lib is 16 bit)
 
Yes, it's possible. You can use the Audio-Lib for input, upsample + filter with CMSIS, and add a modified I2S output. Note for the Audio-Lib you'll need an additional input or output which provides the timing for usb.

BUT an ... upsampling, no, _any_ processing will not increase the soundquality. That is impossible. So, what is the intention?

Thanks, that is great to know!

What would you suggest for a modified I2S output?
And is there any existing project you know of that I could use as a baseline to work from?


As for your question regarding upsampling, the reason is that almost all DAC chips use internal oversampling (to shift the Nyquist freq and reducing aliasing noise, as well as other reasons), and there are many ways to do so. Perfect oversampling does not exist, you can only approach it, costing more processing power (impulses have an infinite tail). Also different algorithms sound differently and shape the sound differently (hence the steep / slow filters on some DACs etc). All this course assuming the system used for listening can resolve the differences.

By oversampling to a higher sample rate before sending it to the DAC, you effectively replace the internal oversampling with your own, which potentially can be better, depending on implementation. So you are right that no new information is created by oversampling, and you are not creating a better source signal. However what you can do is replace an existing oversampling implementation for a better one.

There is software that does this (for example HQPlayer), as well as hardware (for example the Chord Hugo upscaler). I created my own software that does this, and found a better sounding solution than my DAC's internal upsampling (at the cost of a lot of processing power). However I cannot put my PC in the stream always for audio reproduction, and creating a hardware solution would make things more practical.
 
What bit depth are you assuming? Why double floats if only sampling 16 bits (the Audio lib is 16 bit)

Normally 16 or 24 bit (high res audio can be 24 bit) for input. Internally for the algorithm, since the oversampling filter is an IIR filter, calculation errors stack as it iterates, so for internal bit depth 64 would be ideal, but 32 is still ok.

It is a bit like (digital) synthesizers, for their filters they use 16 bits inputs and outputs, but internally they often calculate with 32 or 64 bit depth because errors accumulate in iterative processes like filter processing.
 
IIR isn't used for oversampling normally due to the phase error, and the fact polyphase FIR filters can be _much_ faster.
 
Back
Top