image thumbnail

Waveform Generator GUI 2

by

 

22 Feb 2012 (Updated )

Generate waveformed signal and play it. Interactive GUI with movable datapoints.

update_harmonics(inp)
function update_harmonics(inp)
ic=inp{1};
ax2=inp{2};
hb=inp{3};
cs=inp{4};
sn=inp{5};
nh=inp{6};
Fs=inp{7};
hb2=inp{8};
XLim=get(ic.axesHandle,'XLim');
T=XLim(2)-XLim(1);
dx=1/Fs;
x=0:dx:T-dx;
y=ic.interpData(x,true);
[a b]=calulate_harmonics(nh,T,x,y,cs,sn);
set(hb(1),'YData',a);
set(hb(2),'YData',b);

set(hb2,'YData',sqrt(a.^2+b.^2));

Contact us