how to convert digital data into analog data using matlab code?

조회 수: 106 (최근 30일)
how to convert digital data into analog data using matlab code? and vice versa... i.e., converting back analog data into digital data?
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 25일
What is the range of your analog signal, how many bits are you sing?
Sharada Reddy
Sharada Reddy 2017년 1월 31일
can you tell me how is the DAC in matlab works..? Any codes to convert digital into analog signal

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 25일
편집: Azzi Abdelmalek 2013년 10월 25일
U=10; % range signal from 0 to 10
n=3 % number of bits
q=U/(2^n-1) % quantization interval
t=0:0.1:10; % your time vector
y=abs(10*sin(t)); % your signal
% -------convert to a digital signal yd-----------
a=fix(y/q);
yd=dec2bin(a,n)
% ------you can calculate the signal yq ----------
yq=a*q
%-------------------------------------------------
plot(t,y,'r')
hold on
plot(t,yq,'g')
hold off
  댓글 수: 2
Richard Lyons
Richard Lyons 2017년 1월 20일
Mr. Abdelmalek's code sure looks like analog to digital conversion to me. What the original poster wanted was digital to analog conversion!
Walter Roberson
Walter Roberson 2017년 1월 20일
The original question also asked "and vice versa"

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

추가 답변 (2개)

po-wei huang
po-wei huang 2020년 4월 18일
You can try this sample. Here contain DAC procedure. (But quantizing is skipped.)

Walter Roberson
Walter Roberson 2020년 4월 18일
The only built in facility for converting digital to analog are the ones that output to audio devices such as sound() or audiodevicewriter, unless you want to count graphics operators. Or if you want to include the ability to set and clear DTR on a serial port. Everything else needs to talk to a digital to analog converter.

카테고리

Help CenterFile Exchange에서 Analog Filters에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by