For Programmers: Free Programming Magazines  


Home > Archive > Software Engineering > March 2007 > MATLAB - Direct Digital Synthesis using an MDS









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MATLAB - Direct Digital Synthesis using an MDS
een4gsg

2007-03-08, 4:30 pm

Dear all,

I am currently working on my thesis for the defence industry. My current stage is to simulate a block diagram of a multiplying digital synthesiser (MDS) as a substitute for a traditional DDS within Matlab:

http://img260.imageshack.us/my.php?...figure01qp6.gif

That is the block diagram of the MDS. I have written this code thus far:

clear

mult = 3; % N_in number to multiply with output of counter, varying the frequency of output

counter = 0; % initialise counter

range = 150; % resolution of output sine wave

lut = sin(0:2*pi/range:2*pi-pi/range); % LUT range of values



for i = 1:150 % amount of points stored in LUT

x(i) = lut(mod(round(counter*mult),range)+1); % N_in can be a floating point but will be rounded

counter = counter + 1; % Increment counter

end



stem(x) % Plot output wave


I now, want to model an DAC to take the digital output and represent it as a analog waveform, whilst introducing harmonics and distortion that accuratey represent current DACs.

Any swift responses will be appreciated,

Many thanks

Kam
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com