# Lab 4 prelab 4

 Page 1 / 1
You will investigate the effects of windowing and zero-padding on the Discrete Fourier Transform of a signal, as well as the effects of data-set quantities and weighting windows used in Power Spectral Density estimation.

## Matlab exercise, part 1

Since the DFT is a sampled version of the spectrum of a digital signal, it has certain sampling effects. To explorethese sampling effects more thoroughly, we consider the effect of multiplying the time signal by different window functionsand the effect of using zero-padding to increase the length (and thus the number of sample points) of the DFT. Using thefollowing MATLAB script as an example, plot the squared-magnitude response of the following test cases overthe digital frequencies ${\omega }_{c}=\left[\frac{\pi }{8} , \frac{3\pi }{8}\right]$ .

1. rectangular window with no zero-padding
2. hamming window with no zero-padding
3. rectangular window with zero-padding by factor of four ( i.e. , 1024-point FFT)
4. hamming window window with zero-padding by factor of four

Window sequences can be generated in MATLAB by using the boxcar and hamming functions.

1 N = 256; % length of test signals2 num_freqs = 100; % number of frequencies to test 34 % Generate vector of frequencies to test 56 omega = pi/8 + [0:num_freqs-1]'/num_freqs*pi/4;7 8 S = zeros(N,num_freqs); % matrix to hold FFT results9 1011 for i=1:length(omega) % loop through freq. vector 12 s = sin(omega(i)*[0:N-1]'); % generate test sine wave 13 win = boxcar(N); % use rectangular window14 s = s.*win; % multiply input by window 15 S(:,i) = (abs(fft(s))).^2; % generate magnitude of FFT16 % and store as a column of S 17 end18 19 clf;20 plot(S); % plot all spectra on same graph 21

Make sure you understand what every line in the script does. What signals are plotted?

You should be able to describe the tradeoff between mainlobe width and sidelobe behavior for the various window functions.Does zero-padding increase frequency resolution? Are we getting something for free? What is the relationship betweenthe DFT, $X(k)$ , and the DTFT, $X(\omega )$ , of a sequence $x(n)$ ?

## Matlab exercise, part 2

In this section, you will resolve the two closely spaced sine waves using a Fourier transform method. Consider the signal:

$x\left(n\right)=sin\left(2\pi {f}_{1}n\right)+sin\left(2\pi {f}_{2}n\right)$

consisting of two sine waves of frequency 2000 Hz and 2100 Hz with sampling frequency of 8000 Hz. Here, n is the discrete time index.

Generate a block of 256 samples of x(n) and use the Fast Fourier Transform (fft) command to determine the two frequency components.

What is the closest frequency to 2000 Hz that you can resolve using the Fourier transform method? Which of the following method applied to x(n) results in the best resolving capabilities? Why?

• rectangular window with no zero-padding
• hamming window with no zero-padding
• rectangular window with zero-padding by factor of four (i.e., 1024-point FFT)
• hamming window window with zero-padding by factor of four.

## Matlab excercise part 3

The following Matlab code can be used to generate a pure tone:

fs = 8000; %sampling rate duration = 1; % sect = linspace(0, duration, duration * fs); % time axis freq = 600; % Hzx = sin(2*pi*freq*t);

To listen to it, you can use:

soundsc(x, fs)

This will be useful for testing purposes in Lab 4.

Short-time spectral analysis is an important technique that is used to visualize the time evolution of the frequency content of non-stationary signals, such as speech. The fundamental assumption is that the signal is modeled as being quasi -stationary over short time periods; in many speech applications, this period is on the order of 20-30 milliseconds.

The short-time Fourier transform (STFT) is defined to be:

X(τ,f) = FT{x(t)w(t-τ)}
where f is frequency, FT represents the Fourier transform operation, and w(t-τ) is a window with finite-time support centered at time τ (i.e., it is non-zero for only a short amount of time near τ).

In the case of digital time and frequency, the rate at which τ is evaluated, along with the block size used to compute the FFT determines the amount of data overlap that occurs in evaluating the STFT over time.

The spectrogram is just the magnitude-squared of the STFT, and can be computed in MATLAB:

spectrogram(x, nwin, noverlap);

which computes the STFT using a Hamming window of length nwin, every nwin-noverlap samples. The question of how much to overlap can be understood by asking how many time/frequency samples are required to fully represent the continuous time-frequency STFT; for the interested reader, see the section titled "Analysis of Short Term Spectra" in [Allen77] .

Plot the spectrogram of the first two signals you generate in part 2 with no overlap and 50% overlap. How are the spectrograms different between the two methods?

For students in the Wednesday and Thursday sections: repeat this for the the following frequency-sweep signal: s = chirp(0:1/8000:0.5,1000,0.5,5000);

Type doc chirp to understand the input arguments to the chirp function. What is going on at 0.4 seconds into the signal?

where we get a research paper on Nano chemistry....?
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
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
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
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
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
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
Got questions? Join the online conversation and get instant answers!