# Fourier series and gibbs phenomenon  (Page 2/2)

 Page 2 / 2

## That funny phase

You probably noticed in the last problem that even though the wave forms looked fairly different, the sound was similar. Let's look into this a bit deeper with a simpler sound.

• Create a script file called phasefun.m to put your code in for this problem.
• Pick two harmonic frequencies and generate a signal from two cosines at these frequencies added together and call it sig1 . Use Fs = 8000 (remember that you can reproduce only frequencies that are less than Fs/2 ).
• Now generate a second signal called sig2 exactly the same as the first one, except time delay the second cosine by a half cycle (half of its period).
• Use subplot to show a few periods of both signals, do they look different? Save the plot as phasesigs.tif . What did the time delay do to the phase?
• Play each signal with soundsc , do they sound different?
• Redo sig2 with a few different delays and compare the sound to the first signal.
• Create a sig3 that is one cosine at some frequency. Now add sig3 with a timed delayed version of itself and call it sig4 . Use a quarter cycle delay.
• Use subplot and plot a few periods of sig3 and sig4 . Play them with soundsc , do they sound different to you?
• What is suggested about our hearing capabilities from this experiment?
• You will need to show the TA the following files: phasefun.m phasesigs.tif

## Truncated fourier series

In this section, we'll reconstruct the periodic function x(t) , shown in Figure 1, by synthesizing a periodic signal from a variable number of Fourier Series coefficients, and observe similarities and differences in the synthesized signal.

## Gibbs phenomena

• Create a script file called gibbs.m to put your code in for this problem.
• Click here to download the MATLAB function Ck.m . Take a look at the contents of the function. This function takes one argument $k$ , and creates the $k$ th Fourier series coefficient for the squarewave above:
${C}_{k}\left(1\right)=\frac{-1}{j\pi }=0+j0.3183$ . Plot the magnitude and phase of thecoefficients ${C}_{k}$ for $k\in \left\{-10,-9,\dots ,9,10\right\}$ . The magnitude and phase should be plotted separately using the subplot command, with the magnitude plotted in the top half of the window and the phase in the bottom half. Place frequency $w$ on the x axis. Use the MATLAB command stem instead of plot to emphasize that the coefficients are a function of integer-valued (not continuous) $k$ . Label your plots.
• Save the graph as Coeff.tif .
• Write whatever script/function files you need to implement the calculation of the signal $x(t)$ with a truncated Fourier series:
$x(t)=\sum_{k=-{K}_{\mathrm{max}}}^{{K}_{\mathrm{max}}} {C}_{k}e^{(\mathrm{jk}{\omega }_{0}t)}=\sum_{k=0}^{{K}_{\mathrm{max}}} 2\left|{C}_{k}\right|cos(k{\omega }_{0}t+{\angle C}_{k})$
for a given ${K}_{max}$
You can avoid numerical problems and ensure a real answer if you use the cosine form. For this example, ${w}_{0}=1$ .
• Produce plots of $x(t)$ for $t\in \left[-5 , 5\right]$ for each of the following cases: ${K}_{max}$ = 5; 15; and 30. For all the plots, use as your time values the MATLAB vector t=-5:.01:5 . Stack the three plots in a single figure using the subplot command and include your name in the title of the figure. Save the figure as FourTrunc.tif
• Add clear comments describing what the files do. You will need to show the TA the following files: gibbs.m Coeff.tifFourTrunc.tif

As you add more cosines you'll note that you do get closer to the square wave (in terms of squared error), but that at the edges there is some undershoot and overshoot that becomes shorter in time, but the magnitude of the undershoot and overshoot stay large. This persistent undershoot and overshoot at edges is called Gibbs Phenomenon.

In general, this kind of "ringing" occurs at discontinuities if you try to synthesize a sharp edge out of too few low frequencies. Or, if you start with a real signal and filter out its higher frequencies, it is "as if" you had synthesized the signal from low frequencies. Thus, low-pass filtering (a filter that only passes low-frequencies) will also cause this kind of ringing.

For example, when compressing an audio signal, higher frequencies are usually removed (that is, the audio signal is low-pass filtered). Then, if there is an impulse edge or "attack" in the music, ringing will occur. However, the ringing (called "pre-echo" in audio) can be heard only before the attack, because the attack masks the ringing that comes after it (this masking effect happens in your head). High-quality MP3 systems put a lot of effort into detecting attacks and processing the signals to avoid pre-echo.

## What to show the ta

Show the TA ALL m-files that you created or edited and the files below. gibbs.m Coeff.tifFourTrunc.tif sigsynth.maddcosines.m synthwaves.tifphasefun.m phasesigs.tifany wav files created

An applet here provides a great interface for listening to sinusoids and their harmonics. There are some well-known auditory illusions associated with the perception of pitch here .

Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
hi
Loga
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
Got questions? Join the online conversation and get instant answers! By Angela January By Tamsin Knox By Jonathan Long By Mary Matera By Mistry Bhavesh By Brooke Delaney By Richley Crapo By Janet Forrester By Stephen Voron By