Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

FAIQ UZ ZAMAN MUHAMMAD FAIZAN.

EE-075
SECTION ‘B’
DIGITAL SIGNAL PROCESSING
EE-394
Sampling and Aliasing
Q1. Are there any useful applications of ‘aliasing’ effect?

The general application of aliasing of data is for security purposes.  By using


aliases, we hide the nature and accessibility of data to inspection and alteration
unless we know how the aliasing is functioning.  It acts as a form of security
through obfuscation.

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?

In digital signal processing, spatial anti-aliasing is the technique of minimising the


distortion artifacts known as alaising when representing a high-resolution image
at a lower resolution. Anti-aliasing is used in digital photography, computer
graphics, digital audio, and many other applications.
Anti-aliasing means removing signal components that have a
higher frequency than is able to be properly resolved by the recording (or
sampling) device. This removal is done before (re)sampling at a lower resolution.
When sampling is performed without removing this part of the signal, it causes
undesirable artifacts such as the black-and-white noise 

Q3. Is there any relation (similarity and difference) between Doppler effect and Aliasing
effect?

They are different effects observed in different sciences. Doppler effect is


observed when there is relative motion between a source(which emits energy in
form of waves) and observer which results in apparent change in frequency seen
by the observer. Aliasing effect is observed in communication and it is due to
overlapping of high frequency components in the frequency domain of a band
limited signal during sampling which makes exact recovery of original signal
impossible.
Q4.Suppose you are making a video of a ceiling fan which is rotating at 240 rpm. Describe the
effects, if you will make video at following frame rates:
a) 2 frames/sec
b) 4 frames/sec
c) 8 frames /sec
d) 24 frames/sec

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

The right hand side of the equation can be written as,


New no of levels = (2b)2
Now substituting value of 2b from equation (i) in above equation, we get,
New no of levels = (No of levels)2
If the number of bits are doubled, the number of quantization levels are squared. HENCE PROVED
Q8. A sample output from an ADC is:
1 0 0 1 0 0 1 0
And the bit rate is given as 40 kbps. Also, the amplitude range of the signal is set to be 0.2
volts.
a) What is the resolution of this particular ADC?
b) What could be the maximum frequency (in Hz) present in the analog signal, going in the
ADC, to avoid aliasing?
GIVEN:
No of bits= 8 bits/sample
Bit rate= 40kbps
Dynamic range(Xmax-Xmin) = 0.2V
SOLUTION:
a) Δ =?
no of levels=2b
=28=256
dynamic range
Δ¿
( levels−1 )

= 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.

b)For F1 = 100 Hz:


fd1 = F1 = 100= 0.5samples/cycles
Fs 200
System will work properly as it is the case of critical sampling (Speed information is reserved
and direction information is lost)
For F2 = 200 Hz:
fd2 = F2 = 200 = 1 samples/cycles
Fs 200
Fd2’ = 1-1 = 0 samples/cycles
The system will not work properly because it is the case of under-sampling

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.

Standard for CD quality


b=16
Fs=44100( standard for CD quality)
Fs=2x44100=88200( For stereo)
Bit rate=16 x 88200
Bit rate=1411200 bit/ sec
In bpm
1411200x60= 84672000 bpm
In bytes
84672000/8 =1058400 byte per minute
In KB
1058400/1024 = 10335.9375 Kilo byte per minute
In MB
10335.9375/1024=10.0963 Mega bite per minute

Q12. Calculate the compact disc (CD) capacity required to store one hour of high fidelity
digital stereo audio signal using PCM coding.

For 1 minute stereo audio


10584000 bytes (10 Mb) is required .
Therefore for one hour of high fidelity stereo audio we need
10MB x 60
600MB of compact disc capacity.
Q13. Obtain the signal compression ratio required for storing 12 hours of a Hi Fi stereo audio
signal on a CD with a capacity of 650 megabytes. Assume that the left and right channels are
each sampled at a rate of 44100 Hz and each sample is quantized with 16 bits.

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.

VIDEO: Frames per second = 25 fps


Frames in one minute = 25x60 = 1500 frames
For a single frame, byte per pixel= 3
Bits per pixel= 3x8 = 24 bpp bits
for 1 frame = 720x576x24=9953280 bits
Total bits for 1500 frames= 9953280x1500 = 1.492992x1010 bits
Total bytes = total bits/8 = 1.86624x109 bytes (1.738 GB)
AUDIO: Fs= 44,100 kHz Bits= 16bits/sample
Bitrate = 44100x16= 705600bps
Total bits in 1 minute= 705600x60= 42336000 bits
Total bytes = 5292000 bytes
For stereo audio = 2x5292000 = 10584000 bytes
Total bytes needed for one minute uncompressed video is = 1.86624x109 +
10584000 bytes = 1876824000 bytes (1.747 GB)

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

You might also like