% drmrecord.m  Live-Spektrum des DRM-Signals
%
% 29 jun 2009 Koepken

while(1)
    Fs=48000;
    T=.4;
    y=wavrecord(T*Fs,Fs,1);
    N=length(y);
    N2=ceil(N/2);
    figure(1);
    plot(y);
    set(gca,'ylim',[-1 1]);
    grid on;
    figure(2);
    Y=abs(fft(y))/sqrt(N);
    semilogy((0:N2-1)/N*Fs,Y(1:N2));
    set(gca,'ylim',[.01 10]);
    grid on;
    drawnow;
end;
