# Filtering periodic signals  (Page 2/3)

 Page 2 / 3

Try looking at the frequency content of a few other signals. Note that the fall signal happens to have an even length, so N/2 is an integer. If the length is odd, you may have indexing problems, so it is easiest to just omit the last sample, as in x=x(1:length(x)-1); .

After you make modifications of a signal in the frequency domain, you typically want to get back to the time domain. The MATLAB command ifft will accomplish this task. >>xnew = real(ifft(X)); You need the real command because the inverse Fourier transform returns a vector that is complex-valued, since some changes that you make in the frequence domain could result in that. If your changes maintain complex symmetry in the frequency domain, then the imaginary components should be zero (or very close), but you still need to get rid of them if you want to use the sound command to listen to your signal.

## Low-pass filtering

An ideal low-pass filter eliminates high frequency components entirely, as in: ${H}_{L}^{ideal}\left(\omega \right)=\left\{\begin{array}{cc}1& |\omega |\le B\\ 0& |\omega |>B\end{array}\right\}$ A real low-pass filter typically has low but non-zero values for $|{H}_{L}\left(\omega \right)|$ at high frequencies, and a gradual (rather than an immediate) drop in magnitude as frequency increases. The simplest (and least effective) low-pass filter is given by (e.g. using an RC circuit): ${H}_{L}\left(\omega \right)=\frac{\alpha }{\alpha +j\omega },\text{}\alpha =\text{cutoff frequency}\text{.}$

This low-pass filter can be implemented in MATLAB using what we know about the Fourier transform. Remember that multiplication in the Frequency domain equals convolution in the time domain. If our signal and filter are both in the frequency domain, we can simply multiply them to produce the result of the system. $\begin{array}{l}y\left(t\right)=x\left(t\right)\ast h\left(t\right)\\ Y\left(\omega \right)=X\left(\omega \right)H\left(\omega \right)\end{array}$ Below is an example of using MATLAB to perform low-pass filtering on the input signal x with the FFT and the filter definition above.

The cutoff of the low-pass filter is defined by the constant a . The low-pass filter equation above defines the filter H in the frequency domain. Because the definition assumes the filter is centered around w = 0, the vector w is defined as such. >>load fall %load in the signal>>x = fall;>>X = fft(x); % get the Fourier transform (uncentered)>>N = length(X);>>a = 100*2*pi;>>w = (-N/2+1:(N/2))*Fs/N*2*pi; % centered frequency vector (rad/s)>>H = a ./ (a + i*w); % generate centered sampling of H>>plot(w/(2*pi),abs(H)) % w converted back to Hz for plotting The plot will show the form of the frequency response of a system that we are used to looking at, but we need to shift it to match the form that the fft gave us for x. >>Hshift = fftshift(H); % uncentered version of H>>Y = X .* Hshift'; % filter the signal

If you are having problems multiplying vectors together, make sure that the vectors are the exact same size. Also, even if two vectors are the same length, they may not be the same size. For example, a row vector and column vector of the same length cannot be multiplied element-wise unless one of the vectors is transposed. The ' operator transposes vectors/matrices in MATLAB.
Now that we have the output of the system in the frequency domain, it must be transformed back to the time domain using the inverse FFT. Play the original and modified sound to see if you can hear a difference. Remember to use the sampling frequency Fs. >>y = real(ifft(Y));>>sound(x, Fs) % original sound>>sound(y, Fs) % low-pass-filtered sound The filter reduced the signal amplitude, which you can hear when you use the sound command but not with the soundsc which does automatic scaling. Replay the sounds with the soundsc and see what other differences there are in the filtered vs. original signals. What changes could you make to the filter to make a greater difference?
Sometimes, you may want to amplify the signal so that it has the same height as the original, e.g., for plotting purposes. >>y = y * (max(abs(x))/max(abs(y)))

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!