Engee 文档

Pulse Generator

定频率的矩形脉冲发生器。

类型: PulseGenerator

图书馆中的路径:

/Basic/Sources/Pulse Generator

资料描述

Pulse Generator 以规则间隔产生矩形脉冲。 块波形参数 Amplitude , Period (secs) (Period (number of samples)), Pulse Width (% of period) (Pulse Width (number of samples))和 Phase Delay (secs) (Phase Delay (number of samples))确定输出信号的形状。 下图显示了每个参数如何影响波形。

pulse generator parameter effects

Pulse Generator 它可以输出标量、矢量或矩阵信号。 要生成标量信号,请使用标量设置波形参数。 要生成矢量或矩阵信号,请分别使用矢量或矩阵。 波形参数的每个元素影响输出信号的相应元素。 例如,向量的幅度参数的第一元素确定向量的输出脉冲的第一元素的幅度。

该装置可以在两种模式下运行,由参数定义 Pulse type :

  • 基于时间的仿真模式(Time based).

  • 基于计算步骤的模式(Sample based).

基于时间的仿真模式

在基于时间的仿真模式下,Engee仅在输出数据实际发生变化时才计算块输出的值。 这种方法导致更少的计算。 要启用此模式,请设置参数 Pulse type 在值 Time based.

该装置不支持导致输出信号恒定的配置。 Engee*如果参数返回错误 *Pulse Width (% of period)Period (secs) 满足任何这些条件:

Pulse Generator 在模式 Time basedUse simulation time 它是离散的,尽管它没有字段 Sample time . 作为一个 Sample time 该块选择一个值,该值将同时适合脉冲宽度和周期的整数倍,以免错过使用以下公式的值:

如果设置了块模式 Time basedUse external signal,那么除了所有参数 Amplitude ,必须是传入块的倍数 Sample time 以也避免缺失值。

如果在块中使用矢量参数,那么除了在元素-wise参数之间取最大公约数之外,它还将在计算值之间取最大的除数。

基于计算步骤的模式

在基于计算步骤的模式中,块以由块参数指定的固定间隔计算其输出参数。 要启用此模式,请设置参数 Pulse type 在值 Sample based.

在模式 Sample based 块总是离散的。

基于时间和基于步进的计算模式之间的一个重要区别在于,在基于时间的模式中,块输出基于仿真时间,而在基于步进的模式中,块输出仅取决于仿真的开

港口

输出

# OUT_1 — 产生的输出信号
标量 | 向量 | 矩阵

Details

根据参数生成矩形脉冲信号。

数据类型

Float64`。

复数支持

输入

# t — 时间
标量 | 向量 | 矩阵

Details

用于计算信号值的时间源。

依赖关系

要使用该端口,请将 Time (t) 参数设置为 Use external signal.

数据类型

Float64

复数支持

参数

主要

# Pulse type — 运行方式
Time based | Sample based

Details

设备的运行模式: Time based`或 `Sample based.

某些参数的激活取决于所选的模式。

Time based | Sample based

默认值

Time based

程序使用名称

PulseType

可调谐

可计算

# Time (t) — 时间源
Use simulation time | Use external signal

Details

选择用于计算信号值的时间源:

  • Use simulation time- 设备根据模拟时间生成输出信号。

  • Use external signal- 块根据输入端口 t 的值(可能与模拟时间不同)生成输出脉冲。程序块图标显示源连接的输入端口。

Use simulation time | Use external signal

默认值

Use simulation time

程序使用名称

TimeSource

可调谐

可计算

# Amplitude — 信号振幅
Scalar / array of real and/or complex numbers

Details

生成信号的振幅。

默认值

1

程序使用名称

Amplitude

可调谐

可计算

# Period (secs) — 脉冲周期
Scalar / array of real and/or complex numbers

Details

脉冲周期(秒)。

依赖关系

要使用此参数,请将 Pulse type 设置为 。 Time based.

默认值

10

程序使用名称

Period

可调谐

可计算

# Period (number of samples) — 脉冲周期
Scalar / array of real and/or complex numbers

Details

计算步数中的脉冲周期。

依赖关系

要使用该参数,请将 Pulse type 设置为 Sample based.

默认值

10

程序使用名称

PeriodNum

可调谐

可计算

# Pulse Width (% of period) — 脉宽
Scalar / array of real and/or complex numbers

Details

脉冲宽度定义为周期的百分比。

该值必须在"[0,100]"范围内。

依赖关系

要使用该参数,请将 Pulse type 设置为 Time based.

默认值

5

程序使用名称

PulseWidth

可调谐

可计算

# Pulse Width (number of samples) — 脉宽
Scalar / array of real and/or complex numbers

Details

以计算步数表示的脉冲宽度。

数值必须在 [0,100] 范围内。

依赖关系

要使用该参数,请将 Pulse type 设置为 Sample based.

默认值

5

程序使用名称

PulseWidthNum

可调谐

可计算

# Phase Delay (secs) — 第一脉冲前的延迟
Scalar / array of real and/or complex numbers

Details

产生第一个脉冲前的延时(秒)。

依赖关系

要使用此参数,请将 Pulse type 设置为 。 Time based.

默认值

0

程序使用名称

PhaseDelay

可调谐

可计算

# Phase Delay (number of samples) — 第一脉冲前的延迟
Scalar / array of real and/or complex numbers

Details

第一个脉冲前的延迟时间按计算步数生成。

依赖关系

要使用该参数,请将 Pulse type 设置为 Sample based.

默认值

0

程序使用名称

PhaseDelayNum

可调谐

可计算

# Sample time — 计算间隔
SampleTime (real number / vector of two real numbers)

Details

以非负数指定计算步骤之间的间隔。

要继承计算步骤,请将此参数设置为 -1

依赖关系

要使用此参数,请将 Pulse type 设置为 Sample based.

默认值

1

程序使用名称

SampleTime

可调谐

可计算

附加选项

C 代码生成: 是