Lab 1
Lab 1
Objective
In this lab we will be able to:
     Generate basic signal like Sine waves, Ramp, Unit impulse, Ramp Signals
Introduction
This report describes the process of generating standard signals using MATLAB.
Standard signals include sine, cosine, square, and sawtooth waves, which are
commonly used in signal processing and communication systems.
Procedure
The MATLAB function 'sine' is used to generate a sine wave, 'cosine' for a cosine wave,
'square' for a square wave, and 'sawtooth' for a sawtooth wave. The amplitude,
frequency, and phase of the signal can be specified as input parameters to the function.
Additionally, the 'linspace' function is used to generate a vector of time points at which
the signal is sampled.
Code
% Define the amplitude, frequency, and phase of the sine wave
A = 1;
f = 2;
phi = 0;
% Define the time vector
t = 0:0.01:1;
% Generate the sine wave
x = A*sin(2*pi*f*t + phi);
% Plot the sine wave
stem(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Sine Wave');
grid
Result
Lab Tasks
Generate and plot unit impulse.
      % Define the time vector
      t = -10:0.01:10;
      % Generate the unit impulse sequence
      x = t==0;
      % Plot the unit impulse sequence
      plot(t,x);
      xlabel('Time');
      ylabel('Amplitude');
      title('Unit Impulse Sequence');
      grid