function plotsig(x,fs)
%   plotsig(x,fs)
% is for investigating signals.
% fs is the sample rate
    xx=x;
    M=length(xx);        % To display the whole signal
    subplot(2,1,1)
    t=(1/fs)*[0:M-1];    % M samples at the sampling frequency
    plot(t,xx(1:M),'g')
    mx=1.2*max(abs(x));axis([0 M/fs -mx mx]);
    xlabel('time in seconds')
    title('time snapshot')
    subplot(2,1,2)
    spectrm(x,fs)        % outside function
    sc=max(x);
    sound(x/sc,fs)