Spin Semiconductor Forum Index Spin Semiconductor
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Aliasing from clipping

 
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development
View previous topic :: View next topic  
Author Message
Digital Larry



Joined: 12 Nov 2012
Posts: 274

PostPosted: Sun Feb 14, 2016 8:36 am    Post subject: Aliasing from clipping Reply with quote

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.

Code:

;------ 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.
Back to top
View user's profile Send private message Visit poster's website
Digital Larry



Joined: 12 Nov 2012
Posts: 274

PostPosted: Sun Feb 14, 2016 7:05 pm    Post subject: Reply with quote

My general conclusion is that using a 0.0-1.0 sine wave, possibly distorted by a few passes of self-multiplication is a better approach for generating square-ish LFO waveforms.

I read a few articles about this today and trying to clean up after creating a brute force square wave is a pretty difficult if not impossible task.
Back to top
View user's profile Send private message Visit poster's website
Digital Larry



Joined: 12 Nov 2012
Posts: 274

PostPosted: Wed Mar 23, 2016 4:36 am    Post subject: Reply with quote

I found the answer - miniBLEPS! I like the word. Probably impractical to make them on the FV-1.

http://www.experimentalscene.com/articles/minbleps.php
Back to top
View user's profile Send private message Visit poster's website
frank



Joined: 19 Oct 2005
Posts: 972

PostPosted: Wed Mar 23, 2016 7:38 am    Post subject: Reply with quote

Interesting, can't do a DFT and IDFT in the FV-1 but an interesting bit of code.
_________________
Frank Thomson
Experimental Noize
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group