| 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 |