Professional Documents
Culture Documents
Faiq Uz Zaman Muhammad Faizan. EE-075 Section B' Digital Signal Processing EE-394
Faiq Uz Zaman Muhammad Faizan. EE-075 Section B' Digital Signal Processing EE-394
EE-075
SECTION ‘B’
DIGITAL SIGNAL PROCESSING
EE-394
Sampling and Aliasing
Q1. Are there any useful applications of ‘aliasing’ effect?
In general terms, aliases are simply shorthand for a piece of data. In network
programming, an alias is smaller to send compared to a larger, more verbose data
element. If we're depending on URIs to encode information, aliasing is vital to
allow us to not exceed URI size limits (yes, they are not unlimited).
Q2. What is the usage of anti-aliasing in sounds, images and video games?
Q3. Is there any relation (similarity and difference) between Doppler effect and Aliasing
effect?
SOLUTION:
Rpm=240=240/60=4 rotation/sec
a-2 frames/sec
fd=F/Fs=4/2=2 cycles/sample
fd’=2-1=1
fd’=1-1=0
Hence observer would perceive that the ceiling fan is not rotating.
b-4 frames/sec
fd=F/Fs=4/4=1 cycles/sample
fd’=1-1=0
This frame rate is still not approximate, The observer will again think that fan is
not rotating.
c-8 frames/sec
fd=F/Fs=4/8=1/2 cycles/sample
This is exactly at critical points. The sense of rotation will be clear but the
direction is still not perceivable.
d-24 frames/sec
fd=F/Fs=4/24=1/6 cycles/sample
It is oversampled and both direction and sense of rotation is clock.
Q5. Suppose we want to sample a composite signal composed of cosine waves of various
frequencies. We use this code
n=0:1:100;
x = cos (2 ∗π∗ 100 ∗ n ∗ (1/200)) + cos (2 ∗π∗ 1000 ∗ n ∗ (1/2000)) + cos (2 ∗π ∗ 2000 ∗ n ∗
(1/4000));
Is there anything wrong with the above code?
SOLUTION:
fd1=f1/fs1=100/200=1/2 samples/cycles
fd2=f2/fs2=1000/2000=1/2 samples/cycles
fd3=f3/fs3=2000/4000=1/2 samples/cycles
sampling rate for each signal
fs1=200Hz
fs2=2000Hz
fs3=4000Hz
If we sample the signal with above sample frequencies, then fd=1/2 for each
signal which is the case of critical sampling.
PerNyquist rate
Fs=2Fmax
Hence Fmax=2000 Hz
Fs=2(2000)=4000 samples/sec.
Q6. What is the difference between pixels per inch [ppi] and dots per inch [dpi] in image
signals?
The terms Dots Per Inch (DPI) and Pixels Per Inch (PPI) are commonly used to
describe the resolution of an image. However, the terms do not mean the same
thing and there are distinct differences between the two:
● DPI refers to the number of printed dots contained within one inch of an
image printed by a printer.
● PPI refers to the number of pixels contained within one inch of an image
displayed on a computer monitor.
QUANTIZATION
Q7. Prove that, if the number of bits used to hold a quantized value is doubled, the
number of quantization levels is squared.
PROOF
The relation between bits and number of levels is given by
No of levels = 2b ------(i)
As per given conditions, substituting b=2b;
New no of levels=22b
= 0.2/256-1
=0.784 mVolts/level
b) folding frequency=?
Bitrate=Fs*bits
Fs= 40k/8 =5000 samples/sec
Nyquist frequency is given by
Fmax=Fs/2
=5000/2
Fmax =2500 Hz
Q9. Consider a signal x(t) = sin 2πF1t + sin 2πF2t getting sampled at an unknown sampling
rate. The resolution of its quantizer is 15.686 ∗ 10−3 V/level. The bit rate out of this
system is 1600 bps.
a) This is a bit ADC and its sampling frequency is samples/sec.
b) For F1 = 100 Hz and F2 = 200 Hz, is the system going to work properly? Why or why not?
c) For F1 = 50 Hz and F2 = 100 Hz, is it possible to reduce the bit rate from 1600 bps. Make
sure that there is no aliasing and that the resolution is not worse than 31.5 ∗ 10−3 V/level
SOLUTION:
a). xmax = 2 xmin = -2
bit rate = 1600 bps
Δ = 15.686x10-3 V/level
Δ = xmax – xmin
Levels – 1
15.686x10-3 = 2-(-2)
2b-1
2b – 1 = 4
-3
15.686x10
2b= 4 + 1
15.686x10-3
2b = 256
2b = 2 8
b = 8 bits/simple
bit rate = b x Fs
Fs = 1600 = 200 samples/sec
8
The ADC is of 8 bits with a sampling frequency of 200 samples/sec.
c).We have
F1 = 50 Hz and F2 = 100 Hz
By sampling theorem (Nyquist Criteria)
Fs = 2(Fmax) = 2(100) = 200 samples/sec
Δ = 31.5x10-3 V/level
Δ = xmax – xmin
Levels – 1
levels – 1 = 2-(-2)
31.5x10-3
levels = 4+ 1
31.5x10-3
levels = 128
bits = log2(levels) = log2(128)
bits = 7 bits/sample
Now,
bit rate = Fs x bits = 7 x 200 = 1400 bps
Hence, for F1 = 50 Hz and F2 = 100 Hz, we can reduce bit rate from 1600 bps to 1400 bps.
Q10) a) A signal x(t) = 0.5(cos5000πt + cos6000πt) is being transmitted. The sampling rate
of the transmitter is 9000 samples/sec, and the ADC employed is of 8-bits. Can you
determine the bit rate at which the signal is being currentlytransmitted? The service
provider charges for various bit rates as shown here, how much is being paid currently?
Category Bit rates Prices
(kbps)
A 65-75 Rs. 2500
B 55-65 Rs. 2000
C 45-55 Rs. 1500
D 35-45 Rs. 1000
b) Consider now that the designer can afford to deteriorate ADC resolution to 35 mV/level
at maximum, and the signal to be transmitted remains the same (without aliasing of
course). Can you suggest him any modifications that will result inmonetary savings?
SOLUTION:
a) we have, no of bits =8 bits/sample
Fs=9000 samples/sec
Bit rate = Fs * no of bits
Bit rate=7200 bps
As bit rate is equal to 72k so Rs. 2500 is currently being paid.
dynamic range
b)Δ¿
( levels−1 )
levels-1 = 1/ 35x10-3
levels=28.57142+1
levels=29.5714
no of bits = log2(29.5714)
= 4.88
No of bits = 5 bits/sample
We have,
x(t) = 0.5 (cos5000πt + cos6000πt)
Compare cos(5000πt) by cos(2F1t):
2 x π x F1 x t = 5000 x π x t
F1 = 2500 Hz
Compare cos(6000πt) by cos(2F2t):
2 x π x 2x t = 6000 x π x t
F2 ( Fmax )= 3000 Hz
According to Nyquist Criteria:
Fs = 2(Fmax)
Fs = 2(3000) = 6000 samples/sec
So, bitrate= 5x6 ksample/sec = 30kbps
Designer have to buy a low bit ADC, furthermore he will be less charged because of low bitrate
required for transmission which will cost him less amount of money without aliasing.
FILE SIZES
Q11. Hard disk recording systems for digital audio are becoming widely available. It is often
quoted that to record 1 minute of “CD quality” digital audio in stereo, one needs about 10
Megabytes (MB) of hard disk space. Please, derive this result.
Q12. Calculate the compact disc (CD) capacity required to store one hour of high fidelity
digital stereo audio signal using PCM coding.
Time=12 hrs
Fs=44100 Hz
Bits = 16
Sample rate= Fs x12=44100 x12x3600=1.90512x10 9 samples
Size=1.90512x109 x 2 x16
Size= 6.096384x1010 bits
In bytes
Size = 6.096384x1010/8= 7.62048x109 bytes
In KB
Size=7.62048x109/1024= 7441875 KB
In MB
Size=7441875/1024=7267.45 Mb = 7270 MB
Compression Ratio=7270/650= 11.18
Q14. A digital audio mixing system uses 16 separate recording channels, each sampling at a
48 kHz rate and quantizing each sample with 20 bits. The digitized samples are saved on a
hard disk for further processing. How many megabytes of hard disk space are required to
record a 3-minute audio for a 16-channel recording?
Fs=48KHz
b=20 bits
Time=3min= 3 x 60 =180 sec
Sample=Fs x time = 48x103X180=8.64X106
Size= 8.64x106x20x16=2.7648x109 bits
In bytes
Size=2.7648x109/8= 345.6x106 bytes
In KB
Size=345.6x106/1024=337.5x103 KB
In MB
Size=337.5x103/1024= 329.38 MB
Q15) Consider a digital monochrome CCD camera that records an image x[m, n] at a
resolution of 800 × 1200 picture elements (pixels). Assuming that the human visual system
cannot distinguish between more than 200 different shades of gray, determine
a) How many bytes are required to store a single image.
b) If the CCD camera has 32 million bytes of memory space to store images, how many images
can be saved simultaneously in the camera?
a-colour =200
bits=log2(colours)=log2(200)=7.64=8
total bits=9800x1200)x8=7680000 bits
in bytes
size=7680000/8=960000
b- total size=32000000 bytes
images saved=32000000/96000= 33 pictures.
Q16) Compute the number of bytes needed for one minute of uncompressed video that has
720 × 576 pixels per frame, 25 frames per second, three bytes per pixel, and CD-quality stereo
audio.
REFERENCES:
I. https://www.quora.com/Are-there-any-useful-applications-of-aliasing
II. https://www.howtogeek.com/73704/what-is-anti-aliasing-and-how-does-it-affect-my-photos-
and-images/
III. https://www.quora.com/Is-there-any-relation-similarity-and-difference-between-the-Doppler-
effect-and-the-Aliasing-effect
IV. http://www.edaboard.com/thread312059.html
V. http://sony-eur-eu-en-web--eur.custhelp.com/app/answers/detail/a_id/30671/~/what-is-the-
difference-between-dots-per-inch-(dpi)-and-pixels-per-inch-(ppi)%3F
VI. http://sony-eur-eu-en-web--eur.custhelp.com/app/answers/detail/a_id/30671/~/what-is-the-
difference-between-dots-per-inch-(dpi)-and-pixels-per-inch-(ppi)%3F
VII. https://www.quora.com/Is-there-any-relation-similarity-and-difference-between-the-Doppler-
effect-and-the-Aliasing-effect