annotate dsp/synth/@sine/block_sr.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents ae596261e75f
children
rev   line source
samer@34 1 function [y,phi]=block(o,phi,f)
samer@42 2 % block_sr - generate block of sine wave samples with signal rate control
samer@42 3 %
samer@42 4 % sine/block ::
samer@42 5 % sine ~'sine generator object',
samer@42 6 % real ~'phase at start of block',
samer@42 7 % [[1,N]] ~'frequency at signal rate',
samer@42 8 % -> [[1,N]] ~'block of output samples',
samer@42 9 % real ~'phase at end of block'.
samer@42 10
samer@34 11
samer@34 12 u=cumsum([phi,f],2);
samer@34 13 y=sin(2*pi*u(1:end-1));
samer@34 14 phi=mod(u(end),1);
samer@34 15