image thumbnail

self-made stroboscope with microphone

by

 

GUI for the stoboscope. FFT spectrum, detect frequency, generate drive signal.

change_peak.m
str=get(handles.duty,'string');
duty=str2num(str);
neg=get(handles.neg,'value');
if neg
    a=-0.9;
else
    a=0.9;
end

rmv=get(handles.rmv,'value');
if rmv
    if duty<1
        mn=a*duty;
    else
        mn=a*1;
    end
        
else
    mn=0;
end

if duty<1
    if duty~=0
        %hpp=plot([0 0.5-duty/2 0.5-duty/2 0.5+duty/2 0.5+duty/2 1],[0 0 0.9 0.9 0 0],'r-','parent',handles.axes2);
        set(hpp,'XData',[0 0.5-duty/2 0.5-duty/2 0.5+duty/2 0.5+duty/2 1],'YData',a*[0 0 1 1 0 0]-mn);
    else
        set(hpp,'XData',[0 1],'YData',[0 0]);
    end
else
    %hpp=plot([0 1],[0.9 0.9],'r-','parent',handles.axes2);
    set(hpp,'XData',[0 1],'YData',a*[1 1]-mn);
end

Contact us