NDelay NDelay Icon

NDelay

A delay block that delays its input by n timesteps.

Always initializes the intermediate timesteps with initial_condition. Clock-agnostic.

Usage

DiscreteComponents.NDelay(initial_condition=0)

Parameters:

NameDescriptionUnitsDefault value
nThe number of samples to delay by
initial_conditionThe initial condition of the delayed signal0

Connectors

  • u - This connector represents a real signal as an input to a component (RealInput)
  • y - This connector represents a real signal as an output from a component (RealOutput)

Behavior

Behavior of this component cannot be rendered because it includes path variables.

Source

"""
A delay block that delays its input by `n` timesteps.  

Always initializes the intermediate timesteps with `initial_condition`.
Clock-agnostic.
"""
component NDelay@[input clk extends Discrete]
  "The input signal to delay"
  u = RealInput@[clk]() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -40, "y1": 450, "x2": 60, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "The delayed output signal"
  y = RealOutput@[clk]() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  dummy = DummyDynamics() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  "The number of samples to delay by"
  structural n::Integer
  "The initial condition of the delayed signal"
  parameter initial_condition::Real = 0
relations
  y = u@(clk-n)
  for i in 1:n
    initial u@(clk-i) = initial_condition
  end
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
"""
A delay block that delays its input by `n` timesteps.  

Always initializes the intermediate timesteps with `initial_condition`.
Clock-agnostic.
"""
component NDelay
  "The input signal to delay"
  u = RealInput@[clk]() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -40, "y1": 450, "x2": 60, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "The delayed output signal"
  y = RealOutput@[clk]() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  dummy = DummyDynamics() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  "The number of samples to delay by"
  structural n::Integer
  "The initial condition of the delayed signal"
  parameter initial_condition::Real = 0
relations
  y = u@(clk-n)
  for i in 1:n
    initial u@(clk-i) = initial_condition
  end
metadata {"Dyad": {"doc": {"behavior": false}}}
end


Test Cases

No test cases defined.