GUI Assignments
GUI Assignments
Axes1 Axes2
Q.2 - Show the demo of various operations on signals using MATLAB
GUI. You can choose any basic signals of finite length. Also, signals can be
of shorter duration than the x-axis, so that x-axis value need not be changed
while performing operations.
Drop-Down menu
x1(n) in time
domain:
Choose various operations using
drop-down menu:
1) Addition of two signals x1(n) +
x2(n) Axes1
2) Multiplication of signals x1(n) x2(n) in time
x2(n) domain
3) Time shifting y(n) = x1(n±k)
4) Time scaling y(n) = x1(α n)
Axes2
Time shifting:
y(n) in time
slider1 domain
Time scaling:
slider2
Axes3
Q.3 - Show the demo of convolution (of discrete-time signals) using
MATLAB GUI. You can choose the length of signals. Allow user to
vary the element alpha in the h[n] signal.
:
slider
:
slider2
panel
x(n) in time DTFT of signal (Magnitude
domain spectrum from –pi to pi)
Axes1 Axes2
Q.5 - Let user enter the location of poles and zeros. Use this information to
plot the pole-zero plot and magnitude response of the system in the range of
–pi to pi. Use 2 poles and 2 zeros system - can be real or complex
conjugates roots.
Axes1 Axes2
Q.6 - Consider a simple first order FIR filter (with Pole at origin). In
GUI, zero location should be adjustable using left-right arrow. Location
can be changed from z =-1 to z=1 in the increment of 0.1. Show the
corresponding pole-zero map and Magnitude response of the system.
Similarly, a zero can be fixed at origin, and vary location of pole from 0.9
to -0.9 on real axis.
Location of
For a pole at origin
zero
Axes1 Axes2
Q.7. Generate and plot a square-wave by adding harmonic signals using
MATLAB GUI. Use edit-text to enter the number of harmonics, two static-texts
to display the array of harmonic frequencies and amplitudes, a push-button to
initiate addition, and an axes to plot the square-wave. (Let the fundamental
frequency be 10Hz.)
ADD
No. of harmonics:
edit-text push-button
Harmonic Freq:
static-text1
Amplitudes:
Axes
static-text2
Q.8. Design and test the low-pass filter nature of a moving-average filter using
MATLAB GUI. Consider sinusoidal signal as input, add random-noise to
generate a noisy signal, obtain filtered-signal by passing the noisy-signal through
the designed moving-average filter. Use a slider to vary the value of M, and
radio-buttons to choose the input/output plots. Also plot the magnitude and phase
response of the designed filter.
M:
Magnitude Response
slider Input/Output
Axes2
Input-signal
Phase Response
Noisy-signal
Filtered-signal
Axes3
panel Axes1
Q.9. Generate and plot the single-sided magnitude, and phase spectrum of the
following added signal x(t) = A1 cos(2 f1 t) + A2 cos(2 f2 t) + …….. using
MATLAB GUI. Use slider to choose the number of cosine signals to be added,
and two edit-texts to enter the values of amplitudes A and frequencies f.
No. of
Cosines: Magnitude Spectrum
slider Time-domain Signal
Axes2
A:
edit-text
Phase Spectrum
f:
edit-text
Axes1
Axes3
Q.10 - Show the even and odd parts of an input signal . Also, show the
Magnitude spectrum (two-sided) of even and odd parts.
Time domain
x(n):
Magnitude spectrum
Axes1
Axes2 Axes4
Axes3 Axes5
𝒂
Q.11 - Determine whether the systems, System 1: and
𝟏/𝒂
System 2: form a pair of the invertible system of not.
Here, and are the input and output, respectively, of each
individual system. Also, is a variable. In order to check the invertibility,
cascade System 1 with System 2. The output of System 1 will be the input
to System 2. Give input to System 1 in cascaded structure and then observe
the output from System 2.
Output of
System 1:
slider
Input to
System 1: Axes2
Output of
System 2:
Axes1
Axes3
Q.12 - Through GUI, check whether the system is linear or
not. The value of can be 0 or 1 Give an input and observe the output
. Similarly, give input and observe the output . Then add the
obtained outputs and . Next, give the input to the
given system and observe the obtained output (Let’s say ). Check
is equal to or not.
𝟏 𝟐
slider
Axes5
𝟏 𝟐
𝟏 𝟐
Axes1 Axes3
𝟏 𝟐 Axes6
𝟑
Axes2 Axes4
Axes7
Q.13 - Generate a periodic square wave x[n] with period 2N. It is defined as
DTFS plot
𝟏
slider1
slider2
Axes
Q.14 - Consider three signals , and of different lengths. Add
all of them to obtain a composite signal (perform zero padding for addition
in case lengths of three signals are different.) Verify Parseval’s relation for
composite and each individual signals , and . Let
and be the energy of computed in the time domain and frequency
domain, respectively.
𝟏 𝒕 𝟏 𝒇 𝟏
𝟐 𝒕 𝟐 𝒇 𝟐
𝟒 𝒕 𝒇
ADD
x:
push-button
edit-text
Amplitude: edit-text1
Time-shift:
edit-text2
Axes