Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- close all;
- clc;
- [yt,Fs]=audioread('F:\odliczanie.wav');
- %soundsc(yt)
- t = (0:length(yt)-1)/Fs;
- %yt=horzcat(y1,y2);
- %yt=y1+y2;
- plot(t,yt,'-o');
- grid on;
- axis tight;
- title('odliczanie.wav');
- %title(['Amplitude: ',num2str(A1),' Frequency: ',num2str(F1),' and ',num2str(F2)]);
- xlabel('Time (s)');
- ylabel('amplitude');
- b=fir1(64,[10*2/Fs],'low');
- figure;
- freqz(b,1,Fs,Fs)
- figure
- outlo = filter(b,1,yt);
- subplot(2,1,1)
- plot(t,yt,'k')
- title('Original Signal')
- ys = ylim;
- subplot(2,1,2)
- plot(t,outlo,'k')
- title('Lowpass Filtered Signal')
- xlabel('Time (s)')
- ylim(ys)
- soundsc(outlo);
- figure;
- subplot(2,1,1)
- spectrogram(yt,256,16,Fs/2,Fs);
- title('Original Signal')
- subplot(2,1,2)
- spectrogram(outlo,256,16,Fs/2,Fs);
- title('Lowpass Filtered Signal')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement