How to convert S-parameters (MA format) to transfer function or impulse response?
조회 수: 8 (최근 30일)
이전 댓글 표시
Dear all,
I am trying to convert S-parameters provided by a VNA (Magnitude and phase format) into transfer function or impulse response. I would like to do this in order to filter arbitrary signals generated in MATLAB with this data measured. I would very grateful if you can provide me any information in order to do this.
댓글 수: 0
답변 (1개)
Mathieu NOE
2021년 1월 5일
hello
IMHO, the best way is to find a FIR or IIR filter that mimics the magnitude / phase plot of the FRF - see invfreqz
once the filter is designed , you can do waht you want (filter a signal, generate the impulse response)
below one example :
data = importdata ('beam_experiment.mat');
x = transpose(data.x); %input
y = transpose(data.y); %output
fs = data.fs; % sampling frequency
NFFT = 2048;
NOVERLAP = 0.75*NFFT;
[Txy,F] = tfestimate(x,y,hanning(NFFT),NOVERLAP,NFFT,fs);
% IIR model
W = linspace(0,pi,length(F));
ind = find(F>5 & F <80); % frequency weighting ; data reliable between 5 and 80 Hz
WT = zeros(size(W));
WT(ind) = 1;
NB = 6;
NA = NB+2;
[B,A] = invfreqz(Txy,W,NB,NA,WT,1e4);
% check bode plots
[H,WW] = freqz(B,A,length(F));
figure(1),
subplot(2,1,1),plot(F,20*log10(abs(Txy)),'b',F,20*log10(abs(H)),'r');grid
subplot(2,1,2),plot(F,180/pi*(angle(Txy)),'b',F,180/pi*(angle(H)),'r');grid
% Impulse response
[IR,X] = dimpulse(B,A);
samples = length(IR);
time = 1/fs*(1:samples);
figure(2),
plot(time,IR,'r');grid
title('Impulse response')
xlabel('Time (s)');
ylabel('Amplitude')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Analog Filters에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!