Page 1 of 1

Resetting a sine LFO

Posted: Wed Oct 16, 2013 4:12 pm
by donstavely
Hey Frank, is there any way to reset the phase of a sine LFO?

I had hoped that executing another WLDS instruction would set the sine value to zero and the cosine value to one (or the amplitude value). But it doesn't seem to work that way.

I suppose I can build my own oscillator and reset the initial conditions. Is this what I need to do?

Thanks,
Don

Posted: Wed Oct 16, 2013 8:31 pm
by frank
No, there isn't. They are initialized at start up and run continuously so I think you will need to write your own if you need to reset an LFO in the program.

Posted: Thu Mar 23, 2017 11:20 am
by knutolai
Sorry for re-opening an old topic, but here we go!

Setting the LFO to 0Hz on initialization like this:

Code: Select all

; 0Hz LFO test
;
skp  	run,   START       	
wlds   	SIN0,   	0,   	32767   	; Write & Load sin0 at 0Hz 
sof	0, 0.0		
wrax	sin0_rate, 0	
START: 
;
cho	rdal, SIN0	; Should read as 1.65 volt??
wrax   dacr, 0		; Write result to output
Am I correct to assume that I'll output a zero (or half supply)? I don't have my multimeter handy so I can't check the result.

If I was able to read the cosine of SIN0 would that read as one, or 3.3v? If I were to keep sin0_rate at zero, but adjusted sin0_range would that alter the cosine value? [/code]

Posted: Fri Mar 24, 2017 3:32 pm
by frank
He asked to reset the phase to 0 degrees, not the frequency to 0Hz.