Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- close all;
- [x,fs]=audioread('mbi04czep(2).wav');
- N=length(x);
- czas=[0:1:N-1]/fs;
- tp=0.15;
- tk=0.25;
- Np=round(tp*fs);
- Nk=round(tk*fs);
- Y=x(Np:Nk);
- Nt=length(Y);
- czasY=[Np:1:Nk]/fs;
- figure(1);
- subplot(2,1,1);
- plot(czas,x);
- xlabel('czas');
- ylabel("Amplituda");
- grid on;
- subplot(2,1,2);
- plot(czasY,Y);
- xlabel('czas');
- ylabel("Amplituda");
- grid on
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$44
- clear all;
- close all;
- load("szum_1.mat")
- load('szum_2.mat')
- %czestotliwosc probkowania sygnalu
- fp=250;
- %długośc wektorów
- N=length(szum_1)
- t=[0:1:N-1]/fp;
- figure(2)
- subplot(2,2,1);
- plot(t,szum_1);
- xlabel('czas[s]');
- ylabel('amplituda');
- title('szum 1')
- subplot(2,2,2)
- plot(t,szum_2);
- xlabel('czas[s]');
- ylabel('amplituda');
- title('szum 2')
- N1=20;
- N2=10;
- subplot(2,2,3);
- histogram(szum_1,N1);
- xlabel('przedział wartości');
- ylabel('liczba probek');
- title('szum gaussowski');
- subplot(2,2,4);
- histogram(szum_2,N2);
- xlabel('przedział wartości');
- ylabel('liczba probek');
- title('szum równomierny');
- figure(1)
- xp=szum_1(2:2:N);
- xn=szum_1(1:2:N);
- subplot(2,1,1)
- plot(xn,xp,'.')
- xp2=szum_2(2:2:N);
- xn2=szum_2(1:2:N);
- subplot(2,1,2)
- plot(xn2,xp2,'.')
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- clear all;
- close all;
- tau=1e-6;
- f_start=100;
- f_stop=100e6;
- fs=250e6;
- t=[0:1/fs:tau-(1/fs)];
- x=chirp(t,f_start,tau-(1/fs),f_stop);
- figure(1);
- subplot(2,1,1);
- plot(t,x);
- xlabel('czas')
- ylabel('Amplituda');
- x_del=radar_echo(x);
- Ndel=length(x_del);
- t_del=[0:1:Ndel-1];
- subplot(2,1,2)
- plot(t_del,x_del);
- kor=xcorr(x,x_del);
- figure(2);
- plot(kor);
- [val,idx]=max(kor)
- deley=(idx/fs)/2;
- v=3e8
- dist=v*deley;
Advertisement
Add Comment
Please, Sign In to add comment