how to conwert digital to analog signal?

조회 수: 4 (최근 30일)
Zoran
Zoran 2023년 1월 4일
답변: Aastha 2025년 6월 11일
Hello all,
Is there a DAC block in simulink? I have used the ADC block but now once I’m done with my experiment, I have to convert the signal back to analog. Unfortunately, I couldn’t find a DAC block in simulink. Is there any other way of doing it ? Any help is appreciated.
Thanks
  댓글 수: 2
Bora Eryilmaz
Bora Eryilmaz 2023년 1월 4일
Are you looking for a block that will communicate with a particular microcontroller?
Otherwise, what do you mean by a DAC block in simulink? Something what will convert, say, a 10-bit digital value (0-1023) to an "analog" value with range 0-5V? Without an actual hardware, in pure Simulink this would be just a scaling of the signal.
Zoran
Zoran 2023년 1월 6일
I am looking for a block in pure Simulink, and I am also looking for a block that can help me convert bits to continuous signals which I can use. Do I use the "Gateway Out" element, or something else?

댓글을 달려면 로그인하십시오.

답변 (1개)

Aastha
Aastha 2025년 6월 11일
Hi @Zoran,
As I understand, you are looking to convert a digital signal, composed of bits back into an analog signal in Simulink. As you mentioned, there does not exist a DAC (Digital-to-Analog Converter) block in Simulink.
Here is a workaround: you can use to perform digital-to-analog conversion using a combination of the Bit to Integer Converter block and the First Order Hold block.
Bit to Integer Converter: This block takes a vector of bits and converts it into an unsigned integer. It effectively interprets your digital bitstream as a numeric value, which is the first step in converting digital data into a form that can be used to simulate an analog signal.
First Order Hold: Once you have the numeric (integer) signal, you can use the First Order Hold block to generate a continuous-time approximation of the signal. This block holds each sample value over the sample period and connects them linearly, simulating the smoothing effect you would expect in an analog output.
You can find more detailed information about these blocks in the MathWorks documentation linked below:
I hope this helps!

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by