MATLAB Answers

How do I write MATLAB code for a 1 bit DAC?

조회 수: 107(최근 30일)
Sharada Reddy
Sharada Reddy 20 Jan 2017
답변: ayyoub 28 Feb 2020
I am doing my final year project where I am struck with the 1 bit Digital to Analog Converter block. I want to convert my Digital 1 bit pulse signal into an analog sinusoidal signal. Can anybody tell me how to write1 the MATLAB code to do it? Even the basic command syntax is enough. Thank you.
  댓글 수: 34
Walter Roberson
Walter Roberson 21 Feb 2017
You cannot convert your digital data into analog signal without using hardware to do so. You can at most create simulated analog signals. Which is what we have been discussing.
The digital data you have is nice and clean. There is no point post filtering it and so on. Your simulation of the transport layer would be useless without some distortion of the signal.
But how should be simulate distortion of the signal reasonably accurately? Well, I posted links to File Exchange contributions that allow detailed simulation of optical signal distortion. You said that was too complicated.
So I went back to the GUI output you posted. You posted it in https://www.mathworks.com/matlabcentral/answers/321197-how-do-i-write-matlab-code-for-a-1-bit-dac#comment_423138 . And I used that as a template for how your distortion should look.
This is not a matter of you going through a graphical output and reading off the graph and so on: you already posted representative readings, and I showed you how to use those representative readings to calculate parameters that you can use from now on as your simulated distortion function. Provided, that is, that you transmit in batches of 272 samples.
"the power digital signal will be 1 as it contains only 0 and 1"
First of all, that will not be true for the (simulated) distorted signal: it will have a range of values.
Secondly: your digital signals (1 and 0) are being ideally mapped into +1 to -1. The squares of +1 and -1 are both +1, so Yes, the ideal is constant power. However, you asked for half sine waves, not for square waves, and sine waves take time to transition between +1 and -1.

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

답변(2개)


ayyoub
ayyoub 28 Feb 2020
hey did you manage to make it !

태그

Community Treasure Hunt

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

Start Hunting!

Translated by