ramp_gen

更新时间:2023-07-19 21:17:59 阅读: 评论:0

Description This module generates ramp output of adjustable gain, frequency and dc
offt.
Availability  This IQ module is available in one interface format:
1) The C interface version
Module Properties Type: Target Independent, Application Independent
x281x or x280x
Devices:
Target
C Version File Names: rampgen.c, rampgen.h
IQmath library files for C: IQmathLib.h, IQmath.lib
Item    C version Comments
Code Size□
57/57 words
(x281x/x280x)
Data RAM 0 words•
xDAIS ready No
XDAIS component No IALG layer not implemented
Multiple instances Yes
Reentrancy Yes
• Each pre-initialized “_iq” RAMPGEN structure consumes 14 words in
the data memory
□ Code size mentioned here is the size of the calc() function
C Interface
C Interface
Object Definition
The structure of RAMPGEN object is defined by following structure definition
typedef struct { _iq  Freq;  // Input: Ramp frequency
_iq  StepAngleMax; // Parameter: Maximum step angle
_iq  Angle; // Variable: Step angle
_iq  Gain; // Input: Ramp gain
_iq  Out;  // Output: Ramp signal
_iq  Offt; // Input: Ramp offt
void  (*calc)(); // Pointer to calculation function
浙江二级建造师报名时间} RAMPGEN;
typedef RAMPGEN *RAMPGEN_handle;
Item Name Description Format* Range(Hex)
大柄frequency GLOBAL_Q 80000000-7FFFFFFF
高一英语课文朗读Freq Ramp
Inputs
Gain Ramp gain  GLOBAL_Q 80000000-7FFFFFFF
Offt Ramp offt  GLOBAL_Q 80000000-7FFFFFFF Outputs Out Ramp signal  GLOBAL_Q 80000
000-7FFFFFFF StepAngleMax sv_freq_max = fb*T  GLOBAL_Q 80000000-7FFFFFFF RAMPGEN
parameter
Internal Angle Step angle  GLOBAL_Q 80000000-7FFFFFFF                    *GLOBAL_Q valued between 1 and 30 is defined in the IQmathLib.h header file.
Special Constants and Data types
RAMPGEN
The module definition is created as a data type. This makes it convenient to instance an
interface to ramp generator. To create multiple instances of the module simply declare
variables of type RAMPGEN.
RAMPGEN_handle
Ur defined Data type of pointer to RAMPGEN module
RAMPGEN_DEFAULTS
Structure symbolic constant to initialize RAMPGEN module. This provides the initial
values to the terminal variables as well as method pointers.
Methods
void rampgen_calc(RAMPGEN_handle);
This definition implements one method viz., the ramp generator computation function.
The input argument to this function is the module handle.
C Interface Module Usage
Instantiation
The following example instances two RAMPGEN objects
rg2;
如何交朋友rg1,
RAMPGEN
Initialization
To Instance pre-initialized objects
RAMPGEN rg1 = RAMPGEN_DEFAULTS;
RAMPGEN rg2 = RAMPGEN_DEFAULTS;
Invoking the computation function
rg1.calc(&rg1);
rg2.calc(&rg2);
Example
The following pudo code provides the information about the module usage.
main()
{
}
void interrupt periodic_interrupt_isr()
{
rg1.Freq = freq1;              // Pass inputs to rg1
孩子学英语rg1.Gain= gain1;              // Pass inputs to rg1
rg1.Offt= offt1;              // Pass inputs to rg1
rg2.Freq = freq2 // Pass inputs to rg2
rg2.Gain= gain2;              // Pass inputs to rg2
rg2.Offt= offt2;              // Pass inputs to rg2sunt是什么意思
rg1.calc(&rg1);  // Call compute function for rg1
rg2.calc(&rg2);  // Call compute function for rg1
out1 = rg1.Out; // Access the outputs of rg1
out2 = rg2.Out; // Access the outputs of rg1
}
Technical Backgroundhalf是什么意思
Technical Background
In this implementation the frequency of the ramp output is controlled by a precision frequency generation algorithm which relies on the modulo nature (i.e. wrap-around) of finite length variables in 28xx. One such variable, called StepAngleMax  (a data memory location in 28xx) in this implementation, is ud as a variable to determine the minimum period (1/frequency) of the ramp signal. Adding a fixed step value to the Angle  variable caus the value in Angle  to cycle at a constant rate.                                                        Angle  = Angle  + StepAngleMax  × Freq不可抗力英文
At the end limit the value in Angle  simply wraps around and continues at the next modulo value given by the step size.
For a given step size, the frequency of the ramp output (in Hz) is given by:
m
qnz
2
fs
StepAngle f ×=
where f s  = sampling loop frequency in Hz and m  = # bits in the auto wrapper variable Angle .
From the above equation it is clear that a StepAngle  value of 1 gives a frequency of 0.3052Hz when m=16 and f S =20kHz. This defines the frequency tting resolution of the
For IQmath implementation, the maximum step size in per-unit, StepAngleMax , for a given ba frequency, fb and a defined GLOBAL_Q number is therefore computed as follows:
menubarQ _GLOBAL 2××=s b T  f ax StepAngleM
Equivalently, by using _IQ() function for converting from a floating-point number to a _iq number, the
StepAngleMax  can also be computed as
)(IQ _s b T  f ax StepAngleM ×=
where Ts is the sampling period (c).

本文发布于:2023-07-19 21:17:59,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/182553.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:浙江   课文   时间   报名   朗读   建造师
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图