úterý 9. listopadu 2010

CZS cvičení 7(Matlab)

clc;
clear all;
close all;
f = 5;
fs = 2000;
N = 1000;
t = 0:1/fs:2*(N-1)/fs;

x = sin(2*pi*t);

figure(1);
hold on;



plot(x,'g');
y = quantize(x,32);
plot(y,'r');
y = quantize(x,8);
plot(y,'b');
y = quantize(x,4);
plot(y,'g');

x = zeros(50);
x(1) = 1;
%y = qintegr(x,p,bits);


a_2 = -0.06406405700381;
a_4 = 0.31396849531868;
b_0 = 0.30704320125906;
b_2 = -0.61408640251813;
b_4 = 0.30704320125906;
a = [ 1, 0, a_2, 0, a_4 ];
b = [ b_0, 0, b_2, 0, b_4 ];

figure(2);
zplane(b,a);

Žádné komentáře:

Okomentovat