-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_orfanidis_eq.m
36 lines (27 loc) · 935 Bytes
/
test_orfanidis_eq.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
clear all;
close all;
%Check os
if(ispc)
error('Windows based OS is not supported.');
end
%Include custom MATLAB Toolkit
addpath('./MDSPTK');
%Build configuration file
sampleRateHz = 48000;
numberOfBands = 30; %Do not change it
testDataVectorsLength = sampleRateHz / 4;
gainsdB = '0 0 0 0 3 0 5 0 0 16 0 0 0 0 0 0 0 0 0 0 0 -10 0 0 -5 0 0 -2 0 0';
%Build and run test file
system('make');
run_cmd = sprintf('./eq -f %d -s %d -b %d -g %s', ...
sampleRateHz, testDataVectorsLength, numberOfBands, gainsdB);
system(run_cmd);
%Configure filter analizer from MDSPTK
fa = fanalyzer(sampleRateHz);
% ---- eq class tests ----
fa.freqResp(csvread('butterworth.tstdat'),'log','eq: butterworth');
fa.freqResp(csvread('chebyshev1.tstdat'),'log','eq: chebyshev1');
fa.freqResp(csvread('chebyshev2.tstdat'),'log','eq: chebyshev2');
fa.freqResp(csvread('elliptic.tstdat'), 'log', 'eq: elliptic');
%Clean up all
system('make clean');