Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %dane modelowe sejsmiki refrakcyjnej
- a=load('sejs_2.txt');
- figure; hold on;
- [Np,Nt]=size(a); %ilosc próbek, ilośc tras
- Fs=400;
- dx=25;
- t=(0:(Np-1))'/Fs;
- for k=1:24
- plot(t,a(:,k)+k-1);
- xc=xcorr(a(:,k),a(:,1)); %przesunięcie względem 1. trasy
- FB(k,1)=find(xc==max(xc(:)),1,'first');
- %mamy 24 przesuniecia czasowe
- %musimy przeliczyć przesunięcia na różnice czasu między trasami
- end
- hold off;
- %przesuniecie wzgledem 1.
- FB=(FB-Np)/Fs; %odejmujemy ilosc probek
- G=ones(Nt,2);
- G(:,1)=FB;
- x=(0:Nt-1)'*dx;
- %v=pinv(G'*G)*G'*x ponieważ [AT*A]^(-1)*AT*b gdy Ax=b
- v=pinv(G)*x
- %szereg fouriera
- close all; clear all; clc;
- Fs=100;
- %zakladamy nieskonczonosc=5
- t=-10:(1/Fs):10;
- xt=1.0*(abs(t)<1); %sygnal prostokatny o amp=1
- XT=ones(size(t))/2; %wektor 1/2
- for n=1:50
- an=2*sin(n*pi/2)/(n*pi);
- %zamieniliśmy f nieciągłą na ciągłą
- XT=XT+an*cos(n*pi*t/2);
- end
- plot(t,xt,'.r',t,XT,'g');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement