-------------------------TASK 04--------------------------
Determine the complex conjugate of the exponential signal given in above example and plot its real and imaginary portions.
-------------------------TASK 05--------------------------
Generate the complex valued signal
y(n) = exp (-0.2 + j0.5)n, ‐10≤n≤10
and plot its magnitude, phase, the real part, and the imaginary part in separate subplots.
Lab # 6
OBJECTIVES OF THE LAB
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
In this lab, we will cover the following topics:
Generating Sinusoids
Addition of Sinusoids with Variation in Parameters and their Plots
Linear Phase Shift Concept When Dealing With Sum of Sinusoids
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Sinusoidal sequences are implemented using sin() & cos() functions.
Example: Continuous‐Time Sinusoid
clc;
clear all;
close all; f0 = 3;
A = 5;
t = -1:0.005:1;
y = A*cos(2*pi*f0*t); figure, plot(t, y,'*:');
xlabel('Time, sec'), ylabel('Amplitude'); title('Graph of sinusoid');
Program: Discrete‐Time Sinusoid
clc; clear all;
close all;
M=10; %samples/sec n=-3:1/M:3; A=2;
phase=0; f=1;
x=A * sin(2*pi*f*n + phase);
stem(n,x,'linewidth', 2)
title('Discrete-Time Sine Wave: A sin(2*\pi*f*n + \phi)') xlabel('Time Index')
ylabel('Signal Amplitude') axis([n(1) n(end) -A A]) grid
CREATING PHASE SHIFT
Phase shift can be created by adding an angle to 2πft for a sinusoid.
Example
clc; clear all; close all; fs=1000;
t=-3:1/fs:3; A=2;
phase=0; f=1;
x=A * sin(2*pi*f*t + phase);
plot(t,x, 'linewidth', 2)
title('Continuous-Time Sine Wave: A sin(2*\pi*f*t + \phi)') xlabel('Time Index')
ylabel('Signal Amplitude') axis([t(1) t(end) -A A]) grid
Dostları ilə paylaş: |