<< Chapter < Page Chapter >> Page >
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 ω c 8 3 8 .

  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 ω , 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 ( n ) = sin ( 2 π f 1 n ) + sin ( 2 π f 2 n )

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?

Questions & Answers

what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
What are the treatment for autism?
Magret Reply
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities. before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue.. sometimes due to these physical problems..the diagnosis may be misdiagnosed. treatment for autism. well it depends on the severity. since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision. play therapy. speech therapy. Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game. string and beads game. the more you interact with the child the more effective
Jharna
results you'll get.. please consult a therapist to know what suits best on your child. and last as a parent. I know sometimes it's overwhelming to guide a special kid. but trust the process and be strong and patient as a parent.
Jharna
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, Ece 420 spring 2014. OpenStax CNX. Jan 18, 2014 Download for free at http://cnx.org/content/col11618/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 420 spring 2014' conversation and receive update notifications?

Ask