0% found this document useful (0 votes)
25 views40 pages

Exp 3 4 Prelab 3 4 Farid Mammadov 09.10.2024

Lab report
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views40 pages

Exp 3 4 Prelab 3 4 Farid Mammadov 09.10.2024

Lab report
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Constructor University Bremen

Signals and Systems Lab

Fall Semester 2024

Lab Experiment - Fourier Series and


Fourier Transform

Professor: Uwe Pagel


Students: Farid Mammadov and Naanlep Excel Tanko
Author: Farid Mammadov
Date of execution: 9 October, 2024
Location: Room 54, Research 1, Constructor University, Bremen
Introduction:

This experiment aims to analyze signals using Fourier coefficients and explore the Fourier
transform, focusing on simulating and implementing the Fast Fourier Transform (FFT) rather
than the detailed mathematics. Experimental results got from an oscilloscope will be compared
with MATLAB simulations to identify differences.

Signals can be represented in either time or frequency domains, with Fourier analysis breaking
them down into sinusoidal components. This technique is valuable for applications like filtering
speech or enhancing signal quality. The Fourier transform converts signals from the time
domain to the frequency domain, while the inverse converts them back. The handout covers
Fourier series and transforms for continuous and discrete-time periodic signals.

Prelab Fourier Series and Fourier Transform:

Problem 1:

In the lab, you must be able to express the signal amplitude in Vpp and Vrms, also you have to
know what dBVRMS corresponds to.

1. Given x(t) = 5cos(2π1000t) ,

a. What is the signal amplitude and the Vpp voltage?

A=5V and VPP=2*A=10V

b. What is the VRMS value of the provided signal?

𝐴 5
VRMS= = = 3.54V
2 2

c. What is the amplitude of the spectral peak in dBVrms?

𝑉𝑅𝑀𝑆 5
dBVRMS = 20*log10( ) = 20*log10( ) = 10.97dB
1𝑉 2

2. For a square wave of 1VPP the voltage changes between −0.5V and 0.5V,

a. What is the signal amplitude in VRMS?

VRMS = A = 0.5V
b. What is the amplitude in dBVRMS?

0.5𝑉
dBVRMS = 20*log10( ) = -6.02dB
1𝑉

Problem 2 : Determination of Fourier series coefficients

1. Determine the Fourier series coefficients up to the 5th harmonic of the function f(t) = 4t2

−0.5 < t < 0.5 ; T = 1s ; ω =
𝑇

0.5
1 2
a0 = * ∫ 4𝑡 dt = 0.33
𝑇
−0.5

bn = 0 since it’s and even function and we can shorten the period for an

0.5
4 2 4
a1 = * ∫ 4𝑡 *cos ωt dt = - 2 = -0.41
𝑇 π
0

0.5
4 2 1
a2 = * ∫ 4𝑡 *cos 2ωt dt = 2 = 0.101
𝑇 π
0

0.5
4 2 4
a3 = * ∫ 4𝑡 *cos 3ωt dt = - 2 = -0.045
𝑇 9π
0

0.5
4 2 1
a4 = * ∫ 4𝑡 *cos 4ωt dt = 2 = 0.025
𝑇 4π
0

0.5
4 2 4
a5 = * ∫ 4𝑡 *cos ωt dt = - 2 = -0.016
𝑇 25π
0

2. Use MatLab to plot the original function and the inverse Fourier transform. Put both graphs
into the same diagram.
T = 1;
w0 = 2*pi/T;
t = linspace(-T/2, T/2, 1000);

N = 5;
f_t = zeros(size(t));
a_n_values = zeros(1, N + 1);
for n = 0:N
if n == 0
a_n = 1/3;
else
a_n=(4/(pi^2 *n^2))*cos(pi*n);
end
f_t = f_t + a_n * cos(n * w0 * t);
a_n_values(n+N+1) = a_n;
end

figure;
plot(t,f_t);
xlabel('Time (s)');
ylabel('f(t)');
title('Function Using the Trig Fourier Series(N=5)');

figure;
plot(t,4.*(t.^2));
xlabel('Time (s)');
ylabel('f(t)');
title('Original Function');
Problem 3:

1. Generate a square wave of 1ms period, 2Vpp amplitude, no offset, and duty cycle 50% (hint :
use ’square’ function). Use 200kHz as the sampling frequency for the problem.

2. Plot the square wave in the time domain.

T = 1e-3;
Fs = 200e3;
t = 0:1/Fs:5*T;
Vpp = 2;
square_50 = Vpp * square(2*pi*(1/T)*t, 50);
figure;
plot(t*1e3, square_50);
title('Square Wave (50% Duty Cycle)');
xlabel('Time (ms)');
ylabel('Amplitude (V)');
ylim([-3 3]);
grid on;

3. Obtain the FFT spectrum using Matlab FFT function. Make the FFT length to be the length of
the square wave data vector.
4. Plot the single-sided amplitude spectrum in dBVRMS.
5. Plot the spectrum including only the first four harmonics in dBVRMS. Hint: Use the Matlab
command ’xlim’.
6. Repeat the previous steps using 20% and 33% duty cycles, respectively. Keep period and
amplitude constant.
T = 1e-3;
Fs = 200e3;
t = 0:1/Fs:5*T;
Vpp = 1;

square_50 = Vpp * square(2*pi*(1/T)*t, 50);


square_33 = Vpp * square(2*pi*(1/T)*t, 33);
square_20 = Vpp * square(2*pi*(1/T)*t, 20);

L50 = length(square_50);% L50=L33=L20


L33 = length(square_33);
L20 = length(square_20);

Y_50 = fft(square_50);
P2_50 = abs(Y_50/L50);
P1_50 = P2_50(1:L50/2+1);
P1_50(2:end-1) = 2*P1_50(2:end-1);
P1_50_dBV = 20*log10(P1_50/sqrt(2));
P2_50_dBV = 20*log10(P2_50/sqrt(2));

Y_33 = fft(square_33);
P2_33 = abs(Y_33/L33);
P1_33 = P2_33(1:L33/2+1);
P1_33(2:end-1) = 2*P1_33(2:end-1);
P1_33_dBV = 20*log10(P1_33/sqrt(2));
P2_33_dBV = 20*log10(P2_33/sqrt(2));

Y_20 = fft(square_20);
P2_20 = abs(Y_20/L20);
P1_20 = P2_20(1:L20/2+1);
P1_20(2:end-1) = 2*P1_20(2:end-1);
P1_20_dBV = 20*log10(P1_20/sqrt(2));
P2_20_dBV = 20*log10(P2_20/sqrt(2));

f50 = Fs*(0:(L50/2))/L50; % f50 = f33 = f20


f33 = Fs*(0:(L33/2))/L33;
f20 = Fs*(0:(L20/2))/L20;

f50_double = Fs*(-(L50/2):((L50/2)-1))/L50;
f33_double = Fs*(-(L33/2):((L33/2)-1))/L33;
f20_double = Fs*(-(L20/2):((L20/2)-1))/L20;

figure; %for 50 percent duty cycle


subplot(4,1,1);
plot(t*1e3, square_50);
title('Square Wave (50% Duty Cycle)');
xlabel('Time (ms)');
ylabel('Amplitude (V)');
grid on;

subplot(4,1,2);
plot(f50_double/1e3, P2_50_dBV);
title('Double-Sided Amplitude Spectrum (50% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 50]);
grid on;

subplot(4,1,3);
plot(f50/1e3, P1_50_dBV);
title('Single-Sided Amplitude Spectrum (50% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 50]);
grid on;

subplot(4,1,4);
plot(f50/1e3, P1_50_dBV);
title('First Four Harmonics (50% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 10]);
grid on;

figure; %for 33 percent duty cycle


subplot(4,1,1);
plot(t*1e3, square_33);
title('Square Wave (33% Duty Cycle)');
xlabel('Time (ms)');
ylabel('Amplitude (V)');
grid on;

subplot(4,1,2);
plot(f33_double/1e3, P2_33_dBV);
title('Double-Sided Amplitude Spectrum (33% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 50]);
grid on;

subplot(4,1,3);
plot(f33/1e3, P1_33_dBV);
title('Single-Sided Amplitude Spectrum (33% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 50]);
grid on;

subplot(4,1,4);
plot(f33/1e3, P1_33_dBV);
title('First Four Harmonics (33% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 10]);
grid on;

figure; %for 20 percent duty cycle


subplot(4,1,1);
plot(t*1e3, square_20);
title('Square Wave (20% Duty Cycle)');
xlabel('Time (ms)');
ylabel('Amplitude (V)');
grid on;

subplot(4,1,2);
plot(f20_double/1e3, P2_20_dBV);
title('Double-Sided Amplitude Spectrum (20% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 50]);
grid on;

subplot(4,1,3);
plot(f20/1e3, P1_20_dBV);
title('Single-Sided Amplitude Spectrum (20% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 50]);
grid on;

subplot(4,1,4);
plot(f20/1e3, P1_20_dBV);
title('First Four Harmonics (20% Duty Cycle)');
xlabel('Frequency (kHz)');
ylabel('Amplitude (dBVrms)');
xlim([0 10]);
grid on;

7. Discuss the changes for smaller pulse width. Use Eq. (6.11) to prove your statement. Hint:
Use the subplot command to plot the spectrum magnitude for the three cases 50%, 33% and
20% duty cycle to ease the comparison.

When the duty cycle decreases, there are more peaks in the amplitude spectrum because a
smaller T1 (the pulse width) leads to more harmonics being present. And from the image below
𝑇1
we can see that smaller duty cycles( *100%) introduce more peaks.
𝑇
Problem 4:
2. Using Matlab, read the sound file and plot the first 10ms of the signal.

[y,Fs] =
audioread("s_samp.wav");
t = linspace(0,0.01,Fs*0.01);
y = y(1:length(t));
plot(t,y);
title('Audio sample');
xlabel('Time (s)');
ylabel('Amplitude (V)');
grid on;
The tones forming signal are the frequencies (X-values) highlighted on plot.

[y,Fs] = audioread("s_samp.wav");
L = length(y);
Ts = 1/Fs;
t = 0:Ts:(L-1)*Ts; % Extend time range to cover the whole signal

Y = fft(y);
P2 = abs(Y/L);
P1 = P2(1:(L/2+1));
P1(2:end-1) = 2*P1(2:end-1);

P1_dBVrms = 20*log10(P1 + eps); % Adjust to avoid log of zero

f = Fs*(0:(L/2))/L;
figure;
plot(f/1e3, P1_dBVrms);
title('Single spectrum');
xlabel('Frequency kHz');
ylabel('Amplitude dBVrms');
grid on;
ylim([-50 0]);

Experiment 3. Fourier Series and Fourier Transform

Part 1: FFT Analysis of a Single-Tone Sinusoidal Wave

Equipment Required:

● Agilent 33120a Function Generator


● Tektronix TBS Series Oscilloscope
● BNC Cables
● 50Ω Resistor

Steps:

1. Configure the function generator to produce a sinusoidal wave at 500 Hz with an


amplitude of 2 V peak-to-peak (Vpp) and no DC offset. Connect the output to the
oscilloscope through the 50Ω resistor.
2. Use the oscilloscope’s measurement feature to confirm that the waveform settings are
accurate (frequency and amplitude). Save an image showing the waveform in the time
domain.
3. Activate the FFT function on the oscilloscope to visualize the frequency spectrum of the
signal. Utilize the cursor function to measure key frequency and amplitude values.
4. Capture two screenshots: one showing the entire spectrum and another zoomed in on
the main peak.
5. Adjust the function generator to create a sinusoidal signal with a frequency of 2 kHz and
a 0 dB spectrum peak (no offset). Save images showing the signal in both the time and
frequency domains.

Results for Part 1:


Figure 1. Sinusoidal wave in time domain with respective properties

Figure 2. Overall Spectrum of frequency domain sine(500Hz, 2VPP)


Figure 3. Zoomed in spectrum of frequency domain sine(500Hz, 2VPP)

Figure 4. Sinusoidal wave set such that it has 0dB magnitude at peak in frequency domain
𝐴 𝐴
dBVRMS = 20*log( ) = 0dB => =1 => A=1.414V => VPP=2*A=2.83V
2 2
Figure 5. Spectrum of wave for 0dB magnitude at peak

Part 2: FFT Analysis of a Square Wave

Equipment Required:

● Agilent 33120a Function Generator


● Tektronix TBS Series Oscilloscope
● BNC Cables
● 50Ω Resistor

Steps:

1. Reconfigure the function generator to produce a square wave and set the period to 1
ms, with an amplitude of 2 Vpp and no DC offset. Capture an image of the square wave
as it appears on the oscilloscope in the time domain.
2. Obtain the FFT spectrum using the oscilloscope’s FFT function. Use the zoom feature
and cursors to determine the amplitude and frequency values of the fundamental and
the next four harmonics. Save these measurements.
3. Repeat the procedure, but this time set the duty cycle of the square wave to 20%.
Capture and save the updated time and frequency domain screenshots.

Results for Part 2:


Figure 6. Square wave 1ms period, 2VPP, no offset(mean almost 0)

Figure 7. Spectrum that square wave


Figure 8. Magnitude for fundamental and first harmonic(1kHz and 3kHz)

Figure 9. Magnitude for second and third harmonic(5kHz and 7kHz)


Figure 10. Magnitude for fifth and sixth harmonic(9kHz and 11kHz)

Figure 11. Square wave 20% duty cycle


Figure 12. Spectrum of 20% duty cycle square wave

Figure 13. Magnitude for fundamental and first harmonic(1kHz and 2kHz)
Figure 14. Magnitude for second and third harmonic(3kHz and 4kHz)

Figure 15. Magnitude for fifth harmonic(5kHz)


Part 3: FFT Analysis of a Multi-Tone Sinusoidal Wave

Equipment Required:

● Agilent 33120a Function Generator


● Tektronix TBS Series Oscilloscope
● BNC Cables
● 50Ω Resistor
● Two 10kΩ Resistors, One 100kΩ Resistor
● Auxiliary Function Generator
● DC Power Supply

Steps:

1. Combine the output from the auxiliary function generator with a 2 Vpp, 10 kHz sine wave
from the primary signal generator.
2. Assemble the circuit using the specified resistors, ensuring the setup is correct.
3. Capture an image of the combined signal as displayed on the oscilloscope in the time
domain.
4. Use the FFT function to display the frequency spectrum of the combined signal and take
a screenshot of the spectrum.

By following these procedures, you can effectively measure and analyze the frequency
response and characteristics of various waveforms using the oscilloscope and function
generator.
Results for Part 3:

Figure 16. Multiple-tone sinusoidal wave in time domain

Figure 17. Spectrum of multiple-toned sinusoidal wave


Evaluation:

Part 1:

1. What is the reference value of the oscilloscope for 0dB.


𝑉𝑅𝑀𝑆
We found that inside part of the log should be 1: dBVRMS=20*log10( 1𝑉
) => VRMS=1V

2. Use Matlab to calculate the expected FFT spectra for the parameters given in part 6.3.1.1. Is
the calculated spectra consistent with the measured spectra?

f = 500;
Fs = 5000;
T = 1 / Fs;
L = 2000;
t = (0:L-1)*T;

y = sin(2*pi*f*t);

Y = fft(y);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2 * P1(2:end-1);
P1_dBV = 20*log10(P1/sqrt(2));

f = Fs * (0:(L/2)) / L;

figure;
subplot(2,1,1);
plot(t, y);
title('Sine Wave in Time Domain');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0 0.01]);

subplot(2,1,2);
plot(f, P1_dBV);
title('FFT of Sine Wave');
xlabel('Frequency (Hz)');
ylabel('dBVrms');
We can see from an oscilloscope that at 495 Hz the magnitude is -2.99dB while in MATLAB we
have -3.0103dB at 500 Hz so the values are pretty consistent.

3. Use Matlab to calculate the expected FFT spectra for the parameters given in part 6.3.1.3. Is
the calculated spectra consistent with the measured spectra?

f = 2000;
Fs = 20000;
T = 1 / Fs;
L = 2000;
t = (0:L-1)*T;

y = (sqrt(2))*sin(2*pi*f*t);

Y = fft(y);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2 * P1(2:end-1);
P1_dBV = 20*log10(P1/sqrt(2));
f = Fs * (0:(L/2)) / L;

figure;
subplot(2,1,1);
plot(t, y);
title('Sine Wave in Time Domain');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0 0.01]);

subplot(2,1,2);
plot(f, P1_dBV);
title('FFT of Sine Wave');
xlabel('Frequency (Hz)');
ylabel('dBVrms');
On an oscilloscope we had 0.21dB at 1976 Hz and in MATLAB we had 0dB at 2000 Hz, again
values are very consistent.

Part 2:

1. For frequency domain measurements, the frequency scale needs to be expanded in order to
accurately measure the frequency components. This could be done with the time base (sec/div)
control. What is the effect of doing this on the measured bandwidth? Information can be found in
reference [6] and [7].

Expanding the time base (sec/div) improves frequency resolution by allowing the FFT to
calculate narrower frequency bins, leading to more precise measurement of frequency
components. However, this adjustment does not affect the measured bandwidth, which remains
limited by the sampling rate.

2. Use the hardcopies taken to discuss the effect of changing the duty cycle on the FFT results.

We can see from the oscilloscope hardcopies and from MATLAB plots for different duty cycles
that change in duty cycle mostly meant the amplitude of each frequency component decreased
and the spacing between them also decreased so there are more frequency components
contributing.

Part 3:

Use the hardcopy of the spectrum and discuss the linearity of the FFT.

In the FFT spectrum on an oscilloscope we can see 2 distinct frequencies that pop up and they
are 1kHz and 10kHz when we measure on an oscilloscope. In the time domain we see the
combination of these 2 waves.

Conclusion:
The experiment aimed to explore the Fourier Series and Fourier Transform for various signals,
and it was successful as the measured and calculated values closely matched. As we plotted
the graphs on MATLAB and viewed on an oscilloscope the results were very accurate. We also
changed some circuit components and source properties to analyze the change in time and
frequency domain. Overall, the lab improved our understanding of Fourier Series and Fourier
Transform(frequency domain) and also expanded our knowledge of plotting on MATLAB.
Experiment 4.
Prelab:
Problem 1:
1. Analog signals are usually passed through a low-pass filter prior to sampling. Why is this
necessary?
If a signal has frequency components higher than Nyquist frequency (fN=fS/2), then aliasing
occurs. Which is not desired, since after aliasing occurs (higher than Nyquist frequency
components appear as low frequency components) you cannot recover the original signal
accurately.

2. What is the minimum sampling frequency for a pure sine wave input at 3KHz? Assume that
the signal can be completely reconstructed.
According to Nyquist-Shannon sampling theorem to avoid aliasing we should sample the signal
at frequency at least twice the highest frequency present in the signal.
fsin=3kHz fS>2*fsin fS>6kHz
3. What is the Nyquist frequency?
The Nyquist frequency is the maximum frequency that can be accurately represented when
sampling a signal. If a signal contains frequency components higher than the Nyquist frequency,
they will cause aliasing.

4. What are the resulting frequencies for the following input sinusoids 500Hz, 2.5KHz, 5KHz and
5.5KHz if the signals are sampled by a sampling frequency of 5KHz?

fN=2.5kHz

500Hz => remains 500Hz


2.5kHz => remains 2.5kHz

5kHz is more than fN so it’ll be aliased. To find the frequency component that it’ll appear as we
use following formula: falias = | f - n*fS | where n-integer is the integer value for falias to fall between
[-fN ; fN]

So for us falias = |5kHz - 1*5kHz| = 0Hz which means 5kHz => will appear as 0Hz component
after sampling.

Same story for 5.5kHz: falias = | 5.5kHz - 1*5kHz | = 500Hz


So 5.5kHz => appears as 500Hz component after sampling

5. Mention three frequencies of signal that alias to a 7Hz signal. The signal is sampled by a
constant 30 Hz sampling frequency.
falias = | f - n*30 | = 7Hz
fn=1 = 30 + 7 = 37Hz
fn=2 = 60 + 7 = 67Hz
fn=3 = 90 + 7 = 97Hz

Problem 2:
Consider the sampling shema shown in figure (7.2). The input signal x(t) is given by a sine
function, with an amplitude of 5V peak and a frequency of 50Hz. The sampling signal p(t) is
represented by a unity impulse train. Use an overall sampling rate of 100ksamples/s for the
whole problem.
1. Carry out simulations for the following cases:
(a) Under Sampling (use 48Hz)
(b) Nyquist Sampling
(c) Over Sampling (use 1000Hz)

fs_high = 100e3;
t_end = 0.1;
fs_undersample = 48;
fs_nyquist = 100;
fs_oversample = 1000;

t_undersample = 0:1/fs_undersample:1;
t_nyquist = 0:1/fs_nyquist:t_end;
t_oversample = 0:1/fs_oversample:t_end;
t_high = 0:1/fs_high:t_end;

x_undersample = 5*sin(2*pi*50*t_undersample);
x_nyquist = 5*sin(2*pi*50*t_nyquist);
x_oversample = 5*sin(2*pi*50*t_oversample);
x_continuous = 5*sin(2*pi*50*t_high);

figure;
subplot(4,1,1);
plot(t_high, x_continuous);%just sin wave plotted
title('Continuous 50 Hz Signal');
xlabel('Time (s)');
ylabel('Amplitude (V)');

subplot(4,1,2);
stem(t_undersample, x_undersample, 'r');
%to indicate discretization, plotting discrete points(like diracs)
title('Undersampled at 48 Hz (Aliased to 2 Hz)');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0 1]);

subplot(4,1,3);
stem(t_nyquist, x_nyquist, 'g');
title('Nyquist Sampled at 100 Hz');
xlabel('Time (s)');
ylabel('Amplitude (V)');
ylim([-5 5]);

subplot(4,1,4);
stem(t_oversample, x_oversample, 'b');
title('Oversampled at 1000 Hz');
xlabel('Time (s)');
ylabel('Amplitude (V)');
2. The signal x(t) should be sampled by a rectangular pulse train. Modify the sampling function
p(t), so that the width of the sampling pulse is 50% of the sampling period. Carry out simulations
for the following cases:
(a) Under Sampling
(b) Nyquist Sampling
(c) Over Sampling
fs_high = 100e3;
t_end = 0.5;

fs_nyquist = 100;
fs_oversample = 1000;
fs_undersample = 48;

t_high = 0:1/fs_high:t_end;
x_continuous = 5 * sin(2 * pi * 50 * t_high);

square_nyquist = 0.5 * (square(2 * pi * fs_nyquist * t_high, 50) + 1);


square_oversample = 0.5 * (square(2 * pi * fs_oversample * t_high, 50) + 1);
square_undersample = 0.5 * (square(2 * pi * fs_undersample * t_high, 50) + 1);

sampled_nyquist = x_continuous .* square_nyquist;


sampled_oversample = x_continuous .* square_oversample;
sampled_undersample = x_continuous .* square_undersample;

figure;
subplot(3, 1, 1);
plot(t_high, x_continuous);
title('Input Signal');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0, 0.04]);

subplot(3, 1, 2);
plot(t_high, square_nyquist, 'k');
title('Sampling Pulse Train (100 Hz)');
xlabel('Time (s)');
ylabel('Amplitude');
xlim([0, 0.04]);

subplot(3, 1, 3);
plot(t_high, sampled_nyquist(1:length(t_high)), 'b');
title('Sampled Output (100 Hz)');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0, 0.04]);
hold on;

figure;
subplot(3, 1, 1);
plot(t_high, x_continuous);
title('Input Signal');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0, 0.04]);

subplot(3, 1, 2);
plot(t_high, square_oversample, 'k');
title('Sampling Pulse Train (1000 Hz)');
xlabel('Time (s)');
ylabel('Amplitude');
xlim([0, 0.04]);

subplot(3, 1, 3);
plot(t_high, sampled_oversample(1:length(t_high)), 'b');
title('Sampled Output (1000 Hz)');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0, 0.04]);

figure;
subplot(3, 1, 1);
plot(t_high, x_continuous);
title('Input Signal');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0, t_end]);

subplot(3, 1, 2);
plot(t_high, square_undersample, 'k');
title('Sampling Pulse Train (48 Hz)');
xlabel('Time (s)');
ylabel('Amplitude');
xlim([0, t_end]);

subplot(3, 1, 3);
plot(t_high, sampled_undersample(1:length(t_high)), 'b');
title('Sampled Output (48 Hz)');
xlabel('Time (s)');
ylabel('Amplitude (V)');
xlim([0, t_end]);
Problem 3:
Modify the circuit in figure (7.6) in such a way that a single sampling source can be used to
sample the input signal.
1. Sketch the modified circuit.
2. Explain the operation of the modified circuit.

We can put an inverting amplifier instead of VS- so that instead of saying Vs+ is high then Vs- is
high we can simply say that Vs+ is high(meaning other side is low due to inverter) and Vs+ is
low(meaning voltage going to R2 is high due to inverter).

How does the bridge work(original circuit)?


When Vs+ is high then D1 and D2 are forward biased (D3 and D4 are reverse biased so no
current passes through them) and they will conduct voltage with some drop across D1 and D2
due to forward bias voltage drop, which occurs always when the diode is forward biased. The
V1 voltage passes through D1 because it’s forward biased (anode[p-side] has more potential
than cathode[n-side]) but with slight voltage drop because of again forward bias and the same
thing occurs when V1 further passes through D2 and goes to R_L so that we can take V2 as
output signal.

When Vs- is high (Vs+ is low so D1 and D2 in reverse bias not conducting any voltage).
The D3 and D4 diodes are forward biased because Vs- high means negative voltage incoming
which again makes the anode potential higher than cathode potential. And again we have V1
going through 2 diodes in forward bias which means 2 forward bias voltage drops.
Important to note that Vs+ and Vs- should have bigger voltage values than V1 at least by 0.7V
so that for their respective cycles, diodes remain forward biased and V1 could pass even when
it seems that V1 is going in the reverse bias direction of the diode.
Results:
Part 1: Digital Sampling Oscilloscope
Display -> Dots

Display -> Vectors


f = 24900 Hz

f = 25000 Hz
f = 25020 Hz

f = 25500 Hz
Part 2: Sampling using a sampling bridge
f = 50 Hz(original)

f = 50 Hz(sampled)
f = 200 Hz(original)

f = 200 Hz(sampled)

You might also like