attenuator
Creates a two-port attenuator.
| Library |
|
Syntax
Function call
-
att = attenuator()— creates an attenuator object with attenuation3dB, whose properties are set by default.
-
att = attenuator(Name=Value)— creates an attenuator object with properties specified by one or more arguments of the typeName=Value. Unspecified properties retain their default values.
Arguments
Name-value input arguments
# Name — name of the attenuator
+
"Attenuator" (by default) | line
Details
The name of the attenuator. All names must be valid variable names.
| Типы данных |
|
# Attenuation — insertion loss or attenuation, dB
+
3 (by default) | scalar
Details
The insertion loss or attenuation applied to the signal, specified as a scalar in dB.
| Типы данных |
|
# Zin — input resistance, ohms
+
50 (by default) | positive scalar
Details
Input resistance in ohms, set as a positive scalar.
| Типы данных |
|
# Zout — output resistance, ohms
+
50 (by default) | positive scalar
Details
Output resistance in ohms, set as a positive scalar.
| Типы данных |
|
# NumPorts — number of input and output ports
+
2 (by default) | scalar
Details
The number of ports specified as an integer scalar.
| This argument is read-only. |
| Типы данных |
|
# Terminals — terminal names
+
("p1+", "p2+", "p1−", "p2−") (by default) | tuple of strings
Details
Terminal names specified as a tuple of strings.
| This argument is read-only. |
Examples
Development and calculation of the S-parameters of the attenuator element
Details
We will develop an attenuator element that reduces the amplitude level of the audio signal by 18 dB, while matching the circuit resistance in 600 Om. Let’s output the properties of the attenuator object.
using EngeeRF
att = attenuator(Attenuation=18,Zin=600,Zout=600)
println("Name: ", att.Name)
println("Attenuation: ", att.Attenuation)
println("Zin: ", att.Zin)
println("Zout: ", att.Zout)
println("NumPorts: ", att.NumPorts)
println("Terminals: ", att.Terminals)
Name: Attenuator
Attenuation: 18.0
Zin: 600.0
Zout: 600.0
NumPorts: 2
Terminals: ("p1+", "p2+", "p1-", "p2-")
Calculate the S-parameters of the attenuator element at the frequency 3 kHz. Let’s output the properties of the S-parameter object.
spar = sparameters(att,3e3)
println("Impedance: ", spar.Impedance)
println("Parameters: ", spar.Parameters)
println("Frequencies: ", spar.Frequencies)
println("NumPorts: ", spar.NumPorts)
Impedance: 50.0
Parameters: ComplexF64[0.8423011906310689 + 0.0im 0.0361668634411914 + 0.0im; 0.0361668634411914 + 0.0im 0.8423011906310689 + 0.0im;;;]
Frequencies: [3000.0]
NumPorts: 2