How to convert discrete signal to Continuous signal in Simulink?
33 次查看(过去 30 天)
显示 更早的评论
Hello All,
I am working on one project in which I have to convert signals from continuous to discrete and discrete to continuous. For converting from Continuous to discrete, I am using Zero-order hold block with 0.002 sampling time that is perfectly converting the signals. But when i want to convert it back to continuous from discrete, that ZOH block is not helping me for the conversion.
I have tried to convert those discrete signal through Rate transition block also. but it is still remained in discrete signals only.
Can anyone help me for finding that suitable block to convert discrete signals to continuous signals?
0 个评论
回答(1 个)
Fangjun Jiang
2024-1-23
2 个评论
Paul
2024-1-23
编辑:Paul
2024-1-23
IIUC, all signals in Simulink (when using a continuous solver) are continuous in the mathematical sense, i.e., every signal has a value at any instant in time. I think the answer to this question depends on what the OP is actually attempting to do (for simulation, I'm not sure about code generation for external targets).
In some cases, no additional effort is required. For example, a signal with discrete sample time > 0 can be fed directly into a block with continuous sample time, like an Integrator.
If there is a need to actually convert the sample time of signal from a discrete sample time to continuous but keep the same value (why would that be needed?), then a Rate Transition block can be used (with appropriate block parameters settings). The output will actually be FiM, but I think that's a distinction without a difference in this case because the signal can only change at the input block sample times anyway.
The output of the first order hold does have a continuous sample time, but the value of the signal is changing between samples, which might be unwanted.
Fangjun Jiang
2024-1-24
I'd rather think that all signals in Simulink (or in digital computer) are discrete, rather than continuous like a signal in an analog circuit.
Anyway, not sure why I answered this question as it was dormant for almost two years. But I think it is the right answer in case someone is searching for the same topic. It is explained in the document of the First Order Hold block.
In the document for the Zero-Order Holder block, there is a tip regarding using the Rate Transition block.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Prepare Model Inputs and Outputs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!