0% found this document useful (0 votes)
7 views7 pages

Lab4 NED

Lab experiments detail of ned university pakistan

Uploaded by

Abdullah Tanoli
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)
7 views7 pages

Lab4 NED

Lab experiments detail of ned university pakistan

Uploaded by

Abdullah Tanoli
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
You are on page 1/ 7

LAB SESSION 01

OBJECTIVE:

To study the relationship between discrete-time and continuous time signals by examining
sampling and aliasing.

THEORY:

Signals are physical quantities that carry information in their patterns of variation. Continuous-
time signals are continuous functions of time, while discrete-time signals are sequences of
numbers. If the values of a sequence are chosen from a finite set of numbers, the sequence is known
as a digital signal. Continuous-time, continuous-amplitude signals are also known as analog
signals.

Analog phenomenon is continuous – like a human speech of speaker, or a continuously rotating


disc attached to the shaft of motor etc. With analog phenomena, there is no clear separation
between one point and the next; in fact, between any two points, an infinite number of other points
exist. Discrete phenomenon, on the other hand, is clearly separated. There's a point (in time or
space), and then there's a neighboring point, and there's nothing between the two.

Signal processing is concerned with the acquisition, representation, manipulation, transformation,


and extraction of information from signals. In analog signal processing these operations are
implemented using analog electronic circuits. Converting the continuous phenomena of images,
sound, and motion into a discrete representation that can be handled by a computer is called analog-
to-digital conversion. Digital signal processing involves the conversion of analog signals into
digital, processing the obtained sequence of finite precision numbers using a digital signal
processor or general purpose computer, and, if necessary, converting the resulting sequence back
into analog form. When stored in a digital computer, the numbers are held in memory locations,
so they would be indexed by memory address. Regardless of the medium (either sound or an
image), analog-to-digital conversion requires the same two steps: Sampling and Quantization.
Sampling: This operation chooses discrete (finite) points at which to measure a continuous
phenomenon (which we will also call a signal). In the case of sound, the sample points are evenly
separated in time. In the case of images, the sample points are evenly separated in space.
Sampling Rate: The number of samples taken per unit time or unit space is called the sampling
rate. The frequency of sampled/discrete phenomenon (signal) can be calculated as
fd = F /Fs (cycles/sec )/(samples/sec) = cycles/ samples
Where, F = Frequency of analog or continuous phenomenon (signal). [Unit: cycles/sec]
Fs = Sampling frequency or sampling rate [Unit: samples/sec]
fd = Frequency of Discrete phenomenon (signal). [Unit: cycles/sample]
Sampling Theorem: A continuous time phenomenon or signal like x(t) can be reconstructed
exactly from its samples x(n) = x(nTs), if the samples are taken at a rate Fs = 1/Ts
that is greater than twice the frequency of the signal being sampled i.e. Fs ≥ 2 ∗ F.

Mathematically,

Aliasing: A common problem that arises when sampling a continuous signal is aliasing, where a
sampled signal has replications of its sinusoidal components which can interfere with other
components. It is an effect that causes two discrete time signals to become indistinct due to
improper sampling (fd>1/2 cycles/sample).

PROCEDURE:

1. Simulate and plot two CT signals of 10 Hz and 110 Hz for 0 < t < 0.2 secs.
2. Sample at Fs = 100 Hz and plot them in discrete form.
3. Observe and note the aliasing effects.
4. Explore and learn.
STEPS:
1. Make a folder at desktop and name it as your current directory within MATLAB.
2. Open M-file editor and type the following code:

clear all;close all;clc;


F1 = 10;
F2 = 110;
Fs = 100;
Ts = 1/Fs;
t = [0 : 0.0005 : 0.2];
x1t = cos(2*pi*F1*t);
x2t = cos(2*pi*F2*t);

figure,
plot(t,x1t,t,x2t, 'LineWidth',2);
xlabel('cont time (sec)');
ylabel('Amp');
xlim([0 0.1]);
grid on;
legend('10Hz','110Hz');
title('Two CTCV sinusoids plotted');

3. Save the file as P011.m in your current directory and ‘run’ it, either using F5 key or writing
the file name at the command window.
(Check for the correctness of the time periods of both sinusoids.)

Now add the following bit of code at the bottom of your P011.m file and save.

nTs = [0 :Ts : 0.2];


n = [1 : length(nTs)-1 ];

x1n = cos(2*pi*F1*nTs);
x2n = cos(2*pi*F2*nTs);

figure,
subplot(2,1,1),
stem(nTs,x1n,'LineWidth',2);
grid on;
xlabel('discrete time (sec)');
ylabel('Amp');
xlim([0 0.1]);

subplot(2,1,2)
stem(nTs,x2n,'LineWidth',2);
grid on;
title('110Hz sampled')
xlabel('discrete time(sec)');
ylabel('Amp');
xlim([0 0.1]);

1. Before hitting the ‘run’, just try to understand what the code is doing and try to link it with
what we have studied in classes regarding concepts of frequency for DT signals.
2. Now ‘run’ the file and observe both plots.

To see what is really happening, type the following code at the bottom of your existing P011.m
file and run again.

figure,
plot(t,x1t,t,x2t);
hold;
stem(nTs,x1n,'r','LineWidth',2);

xlabel('time (sec)');
ylabel('Amp');
xlim([0 0.05]);

legend('10Hz','110Hz');

3. Observe the plots.

RESULT:

Explain (write) in your own words the cause and effects of what you just saw.

LAB TASKS:

1. Consider the following CT signal:


x(t) = sin (2 pi F0 t). The sampled version will be:
x(n) = sin (2 pi F0/Fs n),
where n is a set of integers and sampling interval Ts=1/Fs.
Plot the signal x(n) for n = 0 to 99
for Fs = 5 kHz and F1 = 0.5, 2, 3 and 4.5 kHz. Explain the similarities and differences among
various plots.

2. Generate a tone in MATLAB with varying frequency f = 1000,2000,3000,4000, 5000, 6000,


8000, 9000, 25000,-1000,-2000,-3000 Hz with Fs = 8000 samples/sec.
Listen to the tones,and observe at Sounds like what frequency?
Also Specify whether Aliasing is happening or not.

3. Record a sentence in your voice.(you may use Simulink /audacity to record).Change Fs


=44100, 22050, 11025, 8192, 4096 , 2048 , 1024
and observe
a) Voice quality during playback [Excellent/Good/OK/Bad]
b) File size in kilobytes
c) Aliasing happening or not?
NED University of Engineering & Technology
Department of Electrical Engineering

Course Code: EE-394 Course Title: Digital Signal Processing


Laboratory Session No.: ________________________ Date: ______________________________
Psychomotor Domain Assessment Rubric for Laboratory (Level P3)
Extent of Achievement
Skill(s) to be assessed
0 1 2 3 4
Software Menu Unable to Little ability and Moderate ability Reasonable Demonstrates
Identification and understand understanding of and understanding of command over
Usage: and use software menu understanding of software menu software menu
Ability to initialise, software operation, makes software menu operation, makes no usage with frequent
configure and operate menu many mistake operation, makes major mistakes use of advance
software environment lesser mistakes menu options
under supervision, using
menus, shortcuts,
instructions etc.
10% 0 10 20 30 40
Procedural Little to no Slight ability to Mostly correct Correctly recognises Correctly recognises
Programming of given understanding use procedural recognition and and uses procedural and uses procedural
Signal Processing of procedural programming application of programming programming
Scheme: programming techniques for procedural techniques with no techniques with no
Practice procedural techniques coding given programming errors but unable to errors and runs
programming algorithm techniques but run processing processing
techniques, in order to makes crucial scheme successfully successfully
code specific signal errors for the
processing schemes given processing
scheme
15% 0 15 30 45 60
Relating Theoretical Completely Able to recognise Able to recognise Able to recognise Able to recognise
Concepts, Equations unable to some relation relation between relation between relation between
and Transforms to relate between signal signal processing signal processing signal processing
Code: between processing concepts and concepts and concepts and
Recognise relation signal concepts and written code, written code, able to written code, able to
between signal processing written code, unable to do do some completely
processing concepts concepts and unable to do manipulations manipulations manipulate code in
and written code and written code, manipulations line with theoretical
manipulate the code in unable to do concepts
accordance of manipulations
requirements
15% 0 15 30 45 60
Detecting and Unable to Able to find error Able to find error Able to find error Able to find error
Removing Errors: check and messages and messages and messages in messages in
Detect detect error indications in indications in software as well as software along with
Errors/Exceptions and messages and software but no software as well understanding of the understanding
in simulation and indications in understanding of as understanding detecting all of to detect and rectify
manipulate code to software detecting those of detecting some those errors and them
rectify the simulation errors and their of those errors their types
types and their types
15% 0 15 30 45 60

Page 1 of 2
Psychomotor Domain Assessment Rubric for Laboratory (Level P3)
Extent of Achievement
Skill(s) to be assessed
0 1 2 3 4
Graphical Visualisation Unable to Ability to Ability to Ability to Ability to
and Comparison of understand understand and understand and understand and understand and
Signal Processing and utilise utilise utilise utilise visualisation utilise visualisation
Scheme Parameters: visualisation or visualisation and visualisation and and plotting and plotting
Manipulate given plotting plotting features plotting features features features
simulation under features with frequent successfully but successfully, successfully, also
supervision, in order to errors unable to partially able to able to compare and
produce graphs/plots compare and compare and analyse them
for measuring and analyse them analyse them
comparing signal
processing parameters
15% 0 15 30 45 60
Following step-by-step Inability to Able to recognise Able to recognise Able to recognise Able to recognise
procedure to complete recognise and given lab given lab given lab procedures given lab procedures
lab work: perform given procedures and procedures and and perform them and perform them
Observe, imitate and lab procedures perform them perform them by by following by following
operate software to but could not following prescribed order of prescribed order of
complete the provided follow the prescribed order steps, with steps, with no
sequence of steps prescribed order of steps, with occasional mistakes mistakes
of steps frequent mistakes
10% 0 10 20 30 40
Recording Simulation Inability to Able to recognise Able to recognise Able to recognise
Observations: recognise prescribed or prescribed or prescribed or
Observe and copy prescribed or required required simulation required simulation
prescribed or required required simulation measurements but measurements and
simulation results in simulation measurements records them records them
__
accordance with lab measurements but does not incompletely completely, in
manual instructions record according tabular form
to given
instructions
10% 0 10 30 40
Discussion and Complete Slight ability to Moderate ability Reasonable ability Full ability to discuss
Conclusion: inability to discuss recorded to discuss to discuss recorded recorded
Demonstrate discussion discuss observations and recorded observations and observations and
capacity on the recorded draw conclusions observations and draw conclusions draw conclusions
recorded observations observations draw conclusions
and draw conclusions and draw
from it, relating them to conclusions
theoretical
principles/concepts
10% 0 10 20 30 40
Total Points (out of 400)
Weighted CLO (Psychomotor Score) (Points/4)
Remarks
Instructor’s Signature with Date

Page 2 of 2

You might also like