semestralka

This commit is contained in:
Filipriec
2025-11-13 21:45:30 +01:00
parent 4f4b634dc8
commit 1efa2dbec6
3 changed files with 54 additions and 12 deletions

29
semestralka/2.m Normal file
View File

@@ -0,0 +1,29 @@
clc;
close all;
clear all;
f0_ohranicene = [25, 20, 10, 12.5];
% semestralka
rawText = fileread('data6.dat');
nums = regexp(rawText, '[-+]?\d+', 'match');
data = int16(str2double(nums));
Fs = 200;
r = 0.95;
b = 1;
a = 1;
for k = 1:length(f0_ohranicene)
theta = 2*pi*(f0_ohranicene(k)/Fs);
b = conv(b, [1, -2*cos(theta), 1]);
a = conv(a, [1, -2*r*cos(theta), r^2]);
end
figure;
zplane(b, a);
figure;
freqz(b, a);
figure;
freqz(b, a);
filtered_data = filter(b, a, double(data));
plot(filtered_data);