Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clear all;
- A=230;
- f=50;
- t=0.1;
- fs1=10000;
- fs2=500;
- fs3=200;
- counter=1;
- w=2*pi*f;
- for i=0:1/fs1:t
- x1(counter)=i;
- y1(counter)=sin(w*i);
- counter=counter+1;
- end
- counter=1;
- for i=0:1/fs2:t
- x2(counter)=i;
- y2(counter)=sin(w*i);
- counter=counter+1;
- end
- counter=1;
- for i=0:1/fs3:t
- x3(counter)=i;
- y3(counter)=sin(w*i);
- counter=counter+1;
- end
- %hold on
- %plot(x1,A*y1,'b-')
- %xlabel('second')
- %ylabel('Volt')
- %plot(x2,A*y2,'ro')
- %plot(x3,A*y3,'kx')
- %rekonstrukcja sygnału dla fs3
- xs=zeros(size(x1));
- for k=1:length(x3),
- st = y3(k)*sinc(fs3*(x1-x3(k)));
- xs = xs + st;
- end;
- figure(2)
- hold on;
- plot(x1,y1,'b-');
- plot(x1,xs,'g-');
- blad=y1-xs;
- plot(x1,blad,'r');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement