<< Chapter < Page Chapter >> Page >
This lab investigates the effect of aliasing. This development of these labs was supported by the National ScienceFoundation under Grant No. DUE-0511635. Any opinions, conclusions or recommendations expressed in this material are those of the authors and donot necessarily reflect the views of the National Science Foundation.

Introduction

Aliasing literally means "by a different name" and is used to explain the effect of under-sampling a continuous signal, which causes frequencies to show up as different frequencies. This aliased signal is the signal at a different frequency. This is usually seen as higher frequencies being aliased to lower frequencies. For a 1d signal in time, the aliased frequency components sound lower in pitch. In 2d space, such as images, this can be observed as parallel lines in pinstripe shirts aliasing into large wavy lines. For 2d signals that vary in time, an example of aliasing would be viewing propellers on a plane that seem to be turning slow when they are actually moving at very high speeds.

The Nyquist sampling rate is twice the highest frequency of the signal. This is the minimum rate needed to prevent aliasing.

Signals and aliasing

In Figure 1 a 500Hz cosine signal is shown in red, and an under-sampled version of the signal in blue.

Aliased Signal

To see the effects of aliasing on a 1kHz cosine signal create an over-sampled, under-sampled, and critically-sampled version of the signal.

  • Plot a cosine at 1kHz showing at least twenty periods. Use a step size (sampling period) of 1/10kHz. This will be our over-sampled signal. Try playing this signal with soundsc . How many samples are needed to make the sound last 2 seconds if the step size is 1/10kHz?
  • Plot the critically-sampled version by applying what you know about Nyquist. Make sure the plot contains at least twenty periods and that you sample at a non-zero point. Listen to this signal with soundsc , does it sound the same?
  • Plot the under-sampled version. Make sure the plot contains at least twenty periods. Listen to this signal with soundsc , how does it sound now?
  • Plot all three signals stacked on top of each other using subplot. Note that the plot command uses straight line interpolation, so your plots will not look smooth like Figure 1 (which actually uses a much finer sampling period an knowledge of the aliased frequency to generate the smooth undersampled result).

Temporal aliasing

Have you ever seen an old western movie and noticed that the wagon wheels appear to turn backwards even though the coach is moving forward? This phenomenon is sometimes referred to as the wagon-wheel effect, but is really an effect of temporal aliasing. You can see the same effect easily on anything with a spoked wheel, such as wheels on a stage coach and airplane propellers.

Wagon-wheels, stage coaches, horses, and airplane propellers?? What's this have to do with signal processing? Actually, quite a lot, not the wagon-wheels directly, but how the images of the wagon-wheels are captured. The video you watch from a movie or tv show is actually sampled in time (hence temporal). Typically a movie is captured at 24 frames per second (FPS).

Now it's your turn to be the cinematographer. For this problem you will take an image of a wagon-wheel and "capture" a MATLAB movie at different frame rates of the wheel rotating. After the movie is made, you will be able to play it back, and if everything worked, be able to see the wheel spin.

A movie of a rotating wheel is a signal in time, and at each instant in time, instead of just one point (like a normal x(t) signal), you have a whole image defined. Thus, if you have an image of an arrow rotating, Figure 2, where the image rotates ten times per second, then the period is 1/10 second, because every 1/10 second the image (signal) is at the same value again. Thus image(t+n/10) = image(t) for all integers n.

Frames of rotating arrow.

If an image rotates at 10 Hz (10 rotations per second), then what is the Nyquist sampling rate so that you can reconstruct the temporal signal? Recall that the signal will be critically sampled when using a sampling rate that is twice the highest frequency in the signal (20 Hz, in this case). Anything above that will be over-sampled, and fewer samples/second will be under-sampled.

Check your understanding: standard film is captured at 24 frames per second. What's the highest frequency of motion that can be reconstructed without aliasing?

Create three movies to show the wheel being over-sampled (appears to be rotating clockwise), under-sampled (appears to be rotating counter-clockwise), and critically-sampled (appears stationary). In each case rotate the wheel at the same rate and only change the frame rate in the movie2avi command (keep the FPS under 30).

Write a Matlab function named wheel.m to create a movie showing the spokes image (download it here ) rotate clockwise at a constant speed. The function should take parameters to change the frame rate and the speed of the rotation. Save the movies as wheel-oversample.avi , wheel-undersample.avi , and wheel-critsample.avi . Label the plot with the frame rate used for each of the movies and the degrees per frame. Here some tips below to help you get started.

  • You will need to use the following Matlab commands: imread , imshow , imrotate , getframe , and movie2avi .
    Passing a negative angle in the imrotate command rotates clockwise, and a positive angle rotates counterclockwise.
    Another useful command you can use to help formatting labels for the figure is sprintf . For more information use the help system in Matlab.
  • Use myImageRotated = imrotate(myImage, theta, 'bilinear', 'crop') for the rotate command.
  • One way to do this is rotate the image by a number of degrees for each frame. The angle can be split into two variables; degPerFrame will be our speed and theta will be the actual number of degrees to rotate for the rotate command. Remember to change degPerFrame to reflect the same speed when changing the frame rate. Now we can setup a for loop something like this, for i = 1:FPS*TIME% rotate the image % display the image% label the plot showing the FPS and speed of the wheelpause(0.01) % allows time for the plot to drawmyMovie(i) = getframe(gcf); % Capture the frame theta = theta + degPerFrame; % Calculate the angle for next frameend % save the avi file
  • Can you use degPerFrame to relate to degrees per second? Given some frame rate, how many degrees pass each frame to make a rotation of 360 take 1 second? At a given frame rate, can you calculate the number of frames are needed to last a given amount of time, say 3 seconds?.
  • Once your for loop is done, you will need to save the movie as an avi to watch it. Use the movie2avi function to save the movie. Why can't we just watch the wheel as it is drawing in the for loop?

Now try the same problem with a different picture of your choice. Can you get it to appear to move backwards? Save the movie as myMovie.avi .

Show the TA the following files: wheel.m wheel-oversample.aviwheel-undersample.avi wheel-critsample.avimyMovie.avi

Questions & Answers

what is microbiology
Agebe Reply
What is a cell
Odelana Reply
what is cell
Mohammed
how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Continuous time linear systems laboratory (ee 235). OpenStax CNX. Sep 28, 2007 Download for free at http://cnx.org/content/col10374/1.8
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Continuous time linear systems laboratory (ee 235)' conversation and receive update notifications?

Ask