Skip to content

Commit

Permalink
Cleanup octave script
Browse files Browse the repository at this point in the history
  • Loading branch information
mike919192 committed May 5, 2024
1 parent effd5c8 commit e001025
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions test_data/WriteImpulse.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
fs2 = fs / 2;
n = 1000;
impulse = [1,zeros(1, n-1)];
step = fs/n;
x = 0:step:fs - step;
N = 8;

f0 = 200;
Q = 1.4;
N = 8;

%HP filter
[z, p, k] = butter ( N, f0 / fs2, "high" );
Expand All @@ -33,17 +32,8 @@
filtered = sosfilt(sos, impulse);
csvwrite("impulse_response/BPimpulse.csv", [3, fs, f0, Q, n, filtered]);

clear all
close all
fs = 39e3;
fs2 = fs / 2;
n = 1000;
impulse = [1,zeros(1, n-1)];
step = fs/n;
x = 0:step:fs - step;
f0 = 2000;
Q = 0.8;
N = 8;

%HP filter
[z, p, k] = butter ( N, f0 / fs2, "high" );
Expand All @@ -64,17 +54,8 @@
filtered = sosfilt(sos, impulse);
csvwrite("impulse_response/BPimpulse2.csv", [3, fs, f0, Q, n, filtered]);

clear all
close all
fs = 39e3;
fs2 = fs / 2;
n = 1000;
impulse = [1,zeros(1, n-1)];
step = fs/n;
x = 0:step:fs - step;
f0 = 15000;
Q = 2.0;
N = 8;

%HP filter
[z, p, k] = butter ( N, f0 / fs2, "high" );
Expand All @@ -94,4 +75,3 @@
sos = zp2sos(z, p, k);
filtered = sosfilt(sos, impulse);
csvwrite("impulse_response/BPimpulse3.csv", [3, fs, f0, Q, n, filtered]);

0 comments on commit e001025

Please sign in to comment.