Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- close all
- clc
- load c1z4dat.dat;
- u = c1z4dat;
- n = 1:length(u);
- %plot(u)
- %title("Przebieg sygnału pliku c1z4dat")
- %hold on
- %wielomian postaci x(n) = a1*n + a0
- x0 = n*0+1;
- x1 = n;
- X = [x0;x1];
- A1 = u/X;
- xp = A1 * X;
- %plot(xp,'r')
- %wielomian postaci x(n) = a2*n^2 + a1*n + a0
- x0 = n*0+1;
- x1 = n;
- x2 = n.^2;
- X = [x0;x1;x2];
- A2 = u/X;
- xp = A2 * X;
- %plot(xp,'r')
- %wielomian postaci x(n) = a2*n^2 + a1*n + a0
- x0 = n*0+1;
- x1 = n;
- x2 = n.^2;
- x3 = n.^3;
- X = [x0;x1;x2;x3];
- A3 = u/X;
- xp = A3 * X;
- %plot(xp,'r')
- %title('Aproksymacja 3 stopnia')
- %aproksymacja wielomianem trygonometrycznym
- x0 = n*0 + 1;
- x1 = cos(n/80);
- x2 = sin(n/80);
- x3 = cos(n/40);
- x4 = sin(n/40);
- x5 = cos(n/20);
- x6 = sin(n/20);
- X = [x0 ;x1; x2; x3; x4; x5; x6];
- A4 = u/X;
- xp = A4*X;
- figure
- plot(u,'gs')
- hold on
- plot(xp,'r');
- title('Aproksymacja wielomianem trygonometrycznym')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement