フィルターのクリア

S-parameters peaks and bandwidth

15 ビュー (過去 30 日間)
mikeeee
mikeeee 2019 年 12 月 30 日
回答済み: Deepak Kumar 2020 年 1 月 9 日
Hey guys
I have a S-parameter touchstone file with such a characteristic:
I want to use findpeaks function for determination of the width and central frequency of each peak, but I get an error.
  2 件のコメント
Deepak Kumar
Deepak Kumar 2020 年 1 月 2 日
What is the error you are getting ? can you share the data ?
You can refer the below documentation link to know more about "findpeaks" function
mikeeee
mikeeee 2020 年 1 月 8 日
Dear Deepak,
I have attached the data-file. The error that I get is:
Attempt to execute SCRIPT findpeaks as a function:
C:\Users\.....\findpeaks.m
Error in findpeaks_sparam (line 3)
peaks = findpeaks(S_ML,freq_sim)
Code is:
S_ML = sparameters('file.s2p');
freq_sim = S_ML.Frequencies;
peaks = findpeaks(S_ML,freq_sim

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

採用された回答

Deepak Kumar
Deepak Kumar 2020 年 1 月 9 日
Couple of points that I noticed in your code:
S_ML is S-parameter object
>> S_ML
S_ML =
sparameters: S-parameters object
NumPorts: 2
Frequencies: [10000×1 double]
Parameters: [2×2×10000 double]
Impedance: 50
rfparam(obj,i,j) returns S-parameter Sij
The input data to “findpeaks” function must be a vector,real and of the type ‘single’ or ‘double’. So, you cannot give S_ML directly as input to the “findpeaks” functions as the S_ML is neither ‘single’ nor ‘double’.
Refer the below documentation for details:
You can extract the parameter values like below
>>x= S_ML. Parameters;
But I noticed that, x= S_ML. Parameters, is of the size and it has complex values. Since 'x' is not a vector rather 3-D data (It’s because it is representing all the S parameters for (S11,S12,S21,S22) for a two port network and 10000 is the number of frequency values at which the S-Parameters are calculated).
Please refer the below documentation for more details:
you can try to extract the individual S values, something like below
>>k1=x(1,1,:) %for S11
and, reshape it to make it a vector
>> k1=reshape(k1,10000,1)
Then, take only the magnitude values,
>>k1=abs(k1);
Now, you will be able to use “findpeaks” function.
Hope this helps!

その他の回答 (1 件)

Deepak Kumar
Deepak Kumar 2020 年 1 月 8 日
Can you try to rename your script file (findpeaks.m) and check if it resolves your issue ?
  1 件のコメント
mikeeee
mikeeee 2020 年 1 月 9 日
No, it does not

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

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by