VCO的非线性的matlab建模,How to use a discrete time VCO to generate a synchronised square wave? (simulink qu...

Hi all. In Simulink, I tried to pass the output of a discrete-time VCO through a zero-crossing detector block. My aim is to produce a squarewave, and the squarewave needs to have its rising edges AND its falling edges synchronised with the ideal zero-crossings of the discrete sinewave of the VCO.

My problem is that the zero-crossing detector output has rising edges occurring at 0.5005, 1.0005, 1.5005 seconds etc. (instead of being exactly at 0.5, 1, and 1.5 seconds). The falling edges are also offset by a small amount of time.

To try get around the issue, I created a function block that basically detects values that are 'relatively' close-to-zero, such as ABSOLUTE VALUE of the discrete time VCO output being <= 1e-8. Relatively close to zero will just mean cases where the discrete sinewave instantaneous value becomes very close to a zero. Every time this 'close-to-zero' condition is detected, I flip the output of my detector.

I notice that computer rounding leads to issues where the discrete VCO output is not EXACTLY 0.0 (at the hypothetical zero crossing point). This means that zero-crossing values could be values like 1E-12 or -5E-13 (instead of being exactly ZERO at the zero crossing). This means that a 'zero crossing' detector is not going to be able to generate a perfectly synchronised square wave - since we don't get perfectly 'zero' values at the zero crossings.

So my function block has the purpose of rounding-off any relatively tiny values to zero. The rounding helps with generating the correct square wave output (ie. with rising edges occurring at the correct times). However, I don't think my rounding method will be completely reliable. Reason: due to simulink/matlab accumlating the rounding error (as time progresses), the thresh-hold value (such as <= 1e-8) will eventually not work. So my method work will work, but only up to a certain point in time.

I have attached my simulink file (from matlab 2013) that shows a square wave output (from the output of a general simulink zero-crossing detector...ie a compare-with-zero block) that doesn't rise and fall at the desired time; and it also shows the desired output (ie. output of my function block method). These outputs can be seen in the simulink SCOPES.

Is there a better method that I could use for generate synchronised square waves from a discrete VCO? I would like to find a method where I know (for sure) that every rising edge is properly aligned with the zero-crossing of the VCO? I'm looking for a method that will have correctly aligned rising edges (regardless of the length of simulation time).

Thanks for any help in advance!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值