Audio Sample Rate Reducer help

I'm trying to figure out a code which will output a pulse wave from an ATtiny84/85, the pulse wave needs to be controllable from around 33khz to around 100hz.

I will use this oscillator to control a switch in an analog audio circuit to create a ring modulator/sample rate reducer style effect.

Is there a way to control a PWM pin to output frequenciess that broad and being controllable with a pot?

is it 33KHz to 100KHz?
not sure about ATtiny84/85 but consider using ESP32, see creating-a-modulated-signal-using-timers-with-a-variable-duty-cycle

No 100hz, im essentially using this oscillator as a carrier frequency to turn on and off a switch that passes audio, creating a ring modulator/sample rate reducer sort of effect.

Ill check out this link though thank you!

I don't think the ATtiny has enough processing power or memory for audio DSP and there is no DAC (no true-analog output).

You don't really want PWM. Regular digital audio is PCM.

With the right processing you could modulate the sample rate, but I assume that would be done temporarily/internally in a buffer so the input & output has a normal-constant sample rate.

Hey Doug,

My plan wasn't to do DSP or convert audio into digital in anyway.
All i planned on doing was generate a pulse wave oscillator which i could control with a pot, spanning frequencies above human hearing (ideally around 30+khz, and being as low as 100hz), i will use this oscillator to turn on and off an analog circuit which will pass audio, creating a ring mod/sample rate reduction effect.

33kHz should be doable with a Tiny85 and Direct Digital Synthesis and you should get at least 10Hz resolution. I'm pretty sure I was able to do 44kHz that way, but it's been a while. Check out the Arduino DDS library.

[edit]
You will need the external 16MHz crystal on the Tiny85, to be clear. It probably won't work with the internal 1MHz clock.

So you are going to be chopping up an audio signal into little segments. Have you considered the distortion products you will be producing?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.