Aliasing from clipping
Posted: Sun Feb 14, 2016 9:36 am
I thought I'd be real clever and make an oscillator that puts out both sine and square waves. Here's my attempt. Be vewy vewy careful as the output goes right to the DAC.
Pot 0 is frequency
Pot 1 is the level control - turn this all the way down to start
Square is on the left, sine on the right.
As I make the frequency go up and down I hear a bunch of "hash" tracking the sound but only on the left. I presume that this is aliasing caused by the brute force clipping to create the square wave.
In some DSP systems this would be handled better by oversampling, which as far as I know can't be done on the FV-1. I can try low pass filtering it, but since aliasing generates components that can be below the input signal's fundamental, I don't know how effective that's going to be.
Any suggestions on band-limiting within the algorithm to minimize the aliasing in the first place?
Maybe it's not such a big deal as I would probably be using this mostly for LFOs, but just wanted to discuss it in general.
Code: Select all
;------ Smoother
RDAX POT0,1.0000000000
RDFX REG0,0.0001500000
WRAX REG0,0.0000000000
;------ Oscillator II
SKP RUN ,3
SOF 0.0000000000,0.5000000000
WRAX REG1,0.0000000000
WRAX REG2,0.0000000000
RDAX REG2,1.0000000000
MULX REG0
RDAX REG1,1.0000000000
WRAX REG1,-1.0000000000
MULX REG0
RDAX REG2,1.0000000000
WRAX REG2,1.0000000000
MULX POT1
WRAX REG3,1.0000000000
SKP NEG,2
SOF 0.0000000000,0.5000000000
SKP GEZ,1
SOF 0.0000000000,-0.5000000000
MULX POT1
WRAX REG4,0.0000000000
;------ Output
RDAX REG4,1.0000000000
WRAX DACL,0.0000000000
RDAX REG3,1.0000000000
WRAX DACR,0.0000000000
Pot 0 is frequency
Pot 1 is the level control - turn this all the way down to start
Square is on the left, sine on the right.
As I make the frequency go up and down I hear a bunch of "hash" tracking the sound but only on the left. I presume that this is aliasing caused by the brute force clipping to create the square wave.
In some DSP systems this would be handled better by oversampling, which as far as I know can't be done on the FV-1. I can try low pass filtering it, but since aliasing generates components that can be below the input signal's fundamental, I don't know how effective that's going to be.
Any suggestions on band-limiting within the algorithm to minimize the aliasing in the first place?
Maybe it's not such a big deal as I would probably be using this mostly for LFOs, but just wanted to discuss it in general.