how to conwert digital to analog signal?

4 visualizzazioni (ultimi 30 giorni)
Zoran
Zoran il 4 Gen 2023
Risposto: Aastha il 11 Giu 2025
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 Commenti
Bora Eryilmaz
Bora Eryilmaz il 4 Gen 2023
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 il 6 Gen 2023
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?

Accedi per commentare.

Risposte (1)

Aastha
Aastha il 11 Giu 2025
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!

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by