微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > how to write a code for 10db bandwidth calculation in CST

how to write a code for 10db bandwidth calculation in CST

时间:03-30 整理:3721RD 点击:
hello dear friends,
I have simulated a structure in CST and I'm trying to optimize it by writing the optimization codes in Macros of the software. the problem I have faced is that how can I write the code for calculation of bandwidth for the plot like the one below. I Want the 10dB bandwidth of the of between points 3 & 4. I cannot limit my frequency sweep because this band shifts to other frequencies while optimization. The code I have used for is the this:

Code:
  f1 = mfmin
    temps1 = Abs(ms11min-threshold)
    f2 = mfmin
    temps2 = Abs(ms11min-threshold)
    For i = 0 To nn-1
      If mfreq(nn-1-i) < mfmin Then
        If Abs(ms11(nn-1-i)-threshold) < temps1 Then
          f1 = mfreq(nn-1-i)
          temps1 = Abs(ms11(nn-1-i)-threshold)
        End If
      End If
      If mfreq(i) > mfmin Then
        If Abs(ms11(i)-threshold) < temps2 Then
          f2 = mfreq(i)
          temps2 = Abs(ms11(i)-threshold)
        End If
      End If
    Next i


the problem is that it sometimes calculate the other 10dB bandwidth between 1&2 or the bandwidth between 1 & 4!
Thank you.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top