Add new minimal example (+ a ton of other, not so important, changes)

This commit is contained in:
Silas Oettinghaus
2025-12-15 15:04:15 +01:00
parent 75dddca1f2
commit 569e72a1fe
43 changed files with 3594 additions and 674 deletions

View File

@@ -139,6 +139,8 @@ classdef ChannelFreqResp < handle
fnew = linspace(0,fstarget/2,length(Target)/2+1);
fnew = fnew(2:end-1);
% Old frequency axis (should be much coarser)
idx_old = find((obj.faxis > 0) .* (obj.faxis < fstarget/2)); %positions of all Frequencies smaller than fs/2
int_fold = obj.faxis(idx_old); %old frequencies from 0 to fs/2
@@ -149,6 +151,10 @@ classdef ChannelFreqResp < handle
% interpolate the frequency response that had a coarse frequency resolution (e.g. 256 bins) to the current frequency resolution (e.g. 21843 bins)
iH = interp1(int_fold, real(H_inv(idx_old)) ,fnew, 'linear') + 1i*interp1(int_fold, imag(H_inv(idx_old)) ,fnew, 'linear');
if 0
figure(7);hold on;plot(fnew,20*log10(abs(iH)))
end
% set all NaN values to the fist/ last non-NaN value
nH = find(~isnan(iH),1,'first');
iH(1:nH)=iH(nH);
@@ -171,6 +177,8 @@ classdef ChannelFreqResp < handle
% five frequencies -> should be the vaue at f=0=DC component?
iH = iH./mean(abs(iH)); %why 1:5??
dc = 20*log10(abs(mean(abs(iH(1:5)))));
% set maximum amplification
% set als values higher than hmax to hmax and keep the
% phase information by multiplication with respective