1.
% VSAH calculation
stem(n/fs,Vin);
grid on;
hold on
stairs(n/fs,Vin)
hold off
title('VSAH with Fs = 128 kHz')
xlabel('Frequency in Hz')
ylabel('VSAH in V')
figure;
% Vout calculation
Vlsb = (Vref/(2^N)) ;
x = fix(Vin/Vlsb); % Decimal equivalent code
Vout = ((x)*Vlsb); % Quantiser output
plot(n/fs,Vout);
title('Vout')
Dept. of ECE, NITK Surathkal
Page 1
Plots:
Vin plot
Page 2
VSAH plot
Vout plot
Page 3
2.
Plot the one-sided frequency spectrum of vout (with log-y axis and
linear-x axis). The frequency bins should have a separation of
fin/4. Compute the signal-to-noise ratio of vout . Comment on your
observation.
Page 4