Task 1 Z-transform and Inverse Z-transform %Lab 10 Task 1 close all clear clc syms f f2 w n; f=sin(w*n); zTransformed=ztrans(f); pretty(zTransformed) pretty(iztrans(zTransformed)) f2=cos(w*n); zTransformed2=ztrans(f2); pretty(zTransformed2) pretty(iztrans(zTransformed2)) Task 2 Cross… Read more »
Task #1 Create a 10 second time vector in MATLAB. Use fs (sampling rate) = 1000 Hz. Using the formula for a chirp from last lab create a chirp signal… Read more »
Task #1 Importing audio into MATLAB Audio can be imported into MATLAB using audioread()or wavread()functions. The example below shows importing a sound and plotting it. clear close all clc [y,… Read more »
Task 1 More Symbolic Algebra %Lab 7 Task 1 close all; clear; clc; syms x y; %y=x^2+5*x+6; figure fplot(‘x^2+5*x+6’,[-50 50]) figure ezpolar(‘cos(x)’) figure ezpolar(‘2+cos(x)’) figure ezpolar(‘sin(x)+cos(x)’) figure ezplot(‘cos(x)’) Task 2… Read more »
Task 1 Symbolic Algebra in Matlab Solving Single Variable Equation Solving Multi Variable Equation Solving Simultaneous Equation Using roots and polyval function Using expand function to expand algebraic expression Using… Read more »
Task 1 Complex Numbers in matlab %Lab 5 Task 1 close all clear clc j=sqrt(-1); x=5+3j; y=6-2j; z=x+2*y; %Decomposing the real and imaginary part of a complex number disp(real(z)); disp(imag(z));… Read more »
Task 1 Generation of unit impulse function. close all clear clc fs=10; a=1; t=-5:1/fs:5; impl=zeros(1,length(t)); for i=1:length(t) if t(i)==0 impl(i)=a; end end figure plot(t,impl) ylim([0 2]) figure stem(t,impl) Task 2… Read more »
Task 1 Plotting a sine curve close all clear clc freq=input(‘Freqiuency of Sine function= ‘); amp=input(‘Amplitude of Function= ‘); phi=input(‘Initial Phase of Sine Function= ‘); time=input(‘End Time for Signal= ‘);… Read more »
Task 1 Introduction to for loop %Use of for loop close all clear clc n=input(‘Number of inputs= ‘); if (n>0) for i=1:n r=input(‘radius= ‘); area=pi*r*r; circ=2*pi*r; fprintf(‘Radius= %g\tArea= %g\tCircumference= %g\n’,… Read more »
Task 1 Installation of MATLAB Task 2 Basic matlab instructions a=4; b=5; c=a+b; %difference between usiong a semicolon at the end of an instruction and not disp(c); c=a-b; c=a*b; c=a/b;… Read more »