Skip to content
LIBRARY
Sources.Tests.LogFrequencySweep.md

Sources.Tests.LogFrequencySweep

Test that validates logarithmic frequency sweep behavior.

This component creates a test setup for validating the LogFrequencySweep block by connecting its output to a Terminator. The sweep starts at wMin=1 and ends at wMax=100 over a duration of 3 seconds. The output ramps logarithmically from 1 to 100, meaning the logarithm of the output performs a linear ramp from log10(1)=0 to log10(100)=2.

Usage

BlockComponents.Sources.Tests.LogFrequencySweep()

Behavior

Source

dyad
"""
Test that validates logarithmic frequency sweep behavior.

This component creates a test setup for validating the `LogFrequencySweep` block by
connecting its output to a `Terminator`. The sweep starts at `wMin=1` and ends at
`wMax=100` over a `duration` of 3 seconds. The output ramps logarithmically from 1
to 100, meaning the logarithm of the output performs a linear ramp from `log10(1)=0`
to `log10(100)=2`.
"""
test component LogFrequencySweep
  "Terminates a signal connection without passing it further"
  terminator = BlockComponents.Routing.Terminator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 155, "y1": 20, "x2": 255, "y2": 120, "rot": 0}
      }
    }
  }
  "Generates a logarithmic frequency sweep from wMin to wMax"
  signal = BlockComponents.Sources.LogFrequencySweep(wMin = 1, wMax = 100, startTime = 0, duration = 3) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      }
    }
  }
relations
  "Connects the sweep output to the terminator input"
  connect(signal.y, terminator.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {
  "Dyad": {
    "icons": {"default": "dyad://BlockComponents/Example.svg"},
    "tests": {"case1": {"stop": 4, "expect": {"signals": ["signal.y", "terminator.u"]}}}
  }
}
end
Flattened Source
dyad
"""
Test that validates logarithmic frequency sweep behavior.

This component creates a test setup for validating the `LogFrequencySweep` block by
connecting its output to a `Terminator`. The sweep starts at `wMin=1` and ends at
`wMax=100` over a `duration` of 3 seconds. The output ramps logarithmically from 1
to 100, meaning the logarithm of the output performs a linear ramp from `log10(1)=0`
to `log10(100)=2`.
"""
test component LogFrequencySweep
  "Terminates a signal connection without passing it further"
  terminator = BlockComponents.Routing.Terminator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 155, "y1": 20, "x2": 255, "y2": 120, "rot": 0}
      }
    }
  }
  "Generates a logarithmic frequency sweep from wMin to wMax"
  signal = BlockComponents.Sources.LogFrequencySweep(wMin = 1, wMax = 100, startTime = 0, duration = 3) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      }
    }
  }
relations
  "Connects the sweep output to the terminator input"
  connect(signal.y, terminator.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {
  "Dyad": {
    "icons": {"default": "dyad://BlockComponents/Example.svg"},
    "tests": {"case1": {"stop": 4, "expect": {"signals": ["signal.y", "terminator.u"]}}}
  }
}
end


Test Cases

Test Case case1

julia
plt

julia
plt