How to cascade s parameter with different frequency vector (different range and step)

27 ビュー (過去 30 日間)
Peng Ye
Peng Ye 2018 年 9 月 12 日
コメント済み: Adrian Salt 2023 年 2 月 5 日
I have two s parameters which has different frequency range and step and I want to cascade them. I'm getting error saying
Error using cascadesparams (line 75) All sparameter objects must use the same frequency vector and the same impedance value.
So what can I do? And I want to get s parameter beyond the overlap frequency band of the two, meaning I may need to do some extrapolation, how can I do that too? Thanks.

回答 (1 件)

Adee
Adee 2021 年 11 月 3 日
編集済み: Adee 2021 年 11 月 3 日
The following seems to work for me (with RF toolbox):
%% concatenate two files
c1=rfckt.datafile; read(c1, 'file1.s4p')
c2=rfckt.datafile; read(c2, 'file2.s4p');
% resample the second file to the same frequency grid as the first file
analyze(c2, c1.AnalyzedResult.Freq);
% Alternatively: analyze(c1, c2.AnalyzedResult.Freq);
sp_c1 = sparameters(c1);
sp_c2 = sparameters(c2);
% if the original port order is the commonly used P1(1,3), P2(2,4),
% the ports must be reordered for cascading to work.
sp_c1.Parameters = snp2smp(sp_c1.Parameters, sp_c1.Impedance, [1 3 2 4]);
sp_c2.Parameters = snp2smp(sp_c2.Parameters, sp_c2.Impedance, [1 3 2 4]);
% Cascade
sp_cascade = cascadesparams(sp_dc1, sp_c2);
% reorder back
sp_cascade.Parameters = snp2smp(sp_cascade.Parameters, sp_cascade.Impedance, [1 3 2 4]);
rfwrite(sp_cascade, 'file3.s4p');
This code does not do any extrapolation. I am not sure how well it would work in general if you call the analyze(...) function with a frequency range that is not included in the data.
  1 件のコメント
Adrian Salt
Adrian Salt 2023 年 2 月 5 日
Cannot thank you enough! This was enourmously helpful! Thank you 1000 times!!!!

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by