# 0.11 Lab 7c - power spectrum estimation  (Page 2/2)

 Page 2 / 2

Use your Pgram function to estimate the power spectrumof $y\left(n\right)$ , ${P}_{yy}\left({\omega }_{k}\right)$ . Plot ${P}_{yy}\left({\omega }_{k}\right)$ vs. ${\omega }_{k}$ .

Next, estimate the power spectrum of $y$ , ${P}_{yy}\left({\omega }_{k}\right)$ using $1/4$ of the samples of $y$ . Do this only using samples ${y}_{0}$ , ${y}_{1}$ , $\cdots$ , ${y}_{255}$ . Plot ${P}_{yy}\left({\omega }_{k}\right)$ vs. ${\omega }_{k}$ .

## Inlab report

1. Hand in your labeled plots and your Pgram code.
2. Compare the two plots. The first plot uses 4 times as many samples as the second one. Is the firstone a better estimation than the second one? Does the first give you a smoother estimation?
3. Judging from the results, when the number of samples of a discrete random variable becomes larger,will the estimated power spectrum be smoother?

## Averaged periodogram

The periodogram is a simple method, but it does not yield very good results.To get a better estimate of the power spectrum, we will introduce Bartlett's method, also known as the averaged periodogram . This method has three steps. Suppose we have a length-N sequence $x\left(n\right)$ .

1. Subdivide $x\left(n\right)$ into $K$ nonoverlapping segments of length $M$ . Denote the ${i}^{th}$ segment as ${x}_{i}\left(n\right)$ .
${x}_{i}\left(n\right)=x\left(n+iM\right),\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}i=0,1,\cdots ,K-1,\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}n=0,1,\cdots ,M-1$
2. For each segment ${x}_{i}\left(n\right)$ , compute its periodogram
${P}_{{x}_{i}{x}_{i}}^{\left(i\right)}\left({\omega }_{k}\right)=\frac{1}{M}{\left|\sum _{n=0}^{M-1},{x}_{i},\left(n\right),{e}^{-j{\omega }_{k}n}\right|}^{2}$
${\omega }_{k}=\frac{2\pi k}{M}$
where $k=0,1,\cdots ,M-1$ and $i=0,1,\cdots ,K-1$ .
3. Average the periodograms over all $K$ segments to obtain the averaged periodogram, ${P}_{xx}^{A}\left(k\right)$ ,
${P}_{xx}^{A}\left({\omega }_{k}\right)=\frac{1}{K}\sum _{i=0}^{K-1}{P}_{{x}_{i}{x}_{i}}^{\left(i\right)}\left({\omega }_{k}\right)$
${\omega }_{k}=\frac{2\pi k}{M}$
where $k=0,1,\cdots ,M-1$ .

Write a Matlab function called AvPgram to calculate the averaged periodogram, using the above steps.The syntax for this function should be

[P,w] = AvPgram(x, K)

where $x$ is a discrete random sequence of length $N$ and the $K$ is the number of nonoverlapping segments. The outputs of this command are $P$ , the samples of the averaged periodogram, and $w$ , the corresponding frequencies of the samples. Both $P$ and $w$ should be vectors of length M where N=KM. You may use your Pgram function.

The command A=reshape(x,M,K) will orient length $M$ segments of the vector $x$ into $K$ columns of the matrix $A$ .

Use your Matlab function AvPgram to estimate the power spectrum of $y\left(n\right)$ which was generated in the previous section. Use all 1024 samples of $y\left(n\right)$ , and let $K=16$ . Plot $P$ vs. $w$ .

## Inlab report

1. Submit your plot and your AvPgram code.
2. Compare the power spectrum that you estimated using the averaged periodogram withthe one you calculated in the previous section using the standard periodogram. What differences do you observe? Which do you prefer?

## Power spectrum and lti systems

Consider a linear time-invariant system with frequency response $H\left({e}^{j\omega }\right)$ , where ${S}_{xx}\left(\omega \right)$ is the power spectrum of the input signal, and ${S}_{yy}\left(\omega \right)$ is the power spectrum of the output signal.It can be shown that these quantities are related by

${S}_{yy}\left(\omega \right)=\mid H\left({e}^{j\omega }\right){\mid }^{2}{S}_{xx}\left(\omega \right)\phantom{\rule{4pt}{0ex}}.$

In the "Periodogram" section, the sequence $y\left(n\right)$ was generated byfiltering an i.i.d. Gaussian (mean=0, variance=1) sequence $x\left(n\right)$ , using the filter in [link] . By hand, calculate the power spectrum ${S}_{xx}\left(\omega \right)$ of $x\left(n\right)$ , the frequency response of the filter, $H\left({e}^{j\omega }\right)$ , and the power spectrum ${S}_{yy}\left(\omega \right)$ of $y\left(n\right)$ .

In computing ${S}_{xx}\left(\omega \right)$ , use the fact that $\mid ab{\mid }^{2}=a{b}^{*}\phantom{\rule{4pt}{0ex}}.$
Plot ${S}_{yy}\left(\omega \right)$ vs. $\omega$ , and compare it with the plots from the "Periodogram" and "Averaged Periodogram" sections. What do you observe?

## Inlab report

1. Hand in your plot.
2. Submit your analytical calculations for ${S}_{xx}\left(\omega \right)$ , $H\left({e}^{j\omega }\right)$ , ${S}_{yy}\left(\omega \right)$ .
3. Compare the theoretical power spectrum of ${S}_{yy}\left(\omega \right)$ with the power spectrum estimated using the standard periodogram. What can you conclude?
4. Compare the theoretical power spectrum of ${S}_{yy}\left(\omega \right)$ with the power spectrum estimated using the averaged periodogram. What can you conclude?

## Estimate the power spectrum of a speech signal

Download the file speech.au for this section. For help on the following Matlab topics select the corresponding link: how to load and play audio signals and specgram function .

The methods used in the last two sections can only be applied to stationary random processes. However, most signals in nature are not stationary. For a nonstationary random process,one way to analyze it is to subdivide the signal into segments (which may be overlapping)and treat each segment as a stationary process. Then we can calculate the power spectrum of each segment. This yieldswhat we call a spectrogram .

While it is debatable whether or not a speech signal is actually random, in many applications it is necessary to model it as being so.In this section, you are going to use the Matlab command specgram to calculate the spectrogram of a speech signal. Read the help for the specgram function . Find out what the command does, and how to calculate and draw aspectrogram.

Draw the spectrogram of the speech signal in speech.au . When using the specgram command with no output arguments, the absolute value of the spectrogram will be plotted.Therefore you can use

speech=auread('speech.au');

to read the speech signal and use

specgram(speech);

to draw the spectrogram.

## Inlab report

1. Hand in your spectrogram plot.
2. Describe the information that the spectrogram is giving you.

#### Questions & Answers

explain and give four Example hyperbolic function
The denominator of a certain fraction is 9 more than the numerator. If 6 is added to both terms of the fraction, the value of the fraction becomes 2/3. Find the original fraction. 2. The sum of the least and greatest of 3 consecutive integers is 60. What are the valu
1. x + 6 2 -------------- = _ x + 9 + 6 3 x + 6 3 ----------- x -- (cross multiply) x + 15 2 3(x + 6) = 2(x + 15) 3x + 18 = 2x + 30 (-2x from both) x + 18 = 30 (-18 from both) x = 12 Test: 12 + 6 18 2 -------------- = --- = --- 12 + 9 + 6 27 3
Pawel
2. (x) + (x + 2) = 60 2x + 2 = 60 2x = 58 x = 29 29, 30, & 31
Pawel
ok
Ifeanyi
on number 2 question How did you got 2x +2
Ifeanyi
combine like terms. x + x + 2 is same as 2x + 2
Pawel
Mark and Don are planning to sell each of their marble collections at a garage sale. If Don has 1 more than 3 times the number of marbles Mark has, how many does each boy have to sell if the total number of marbles is 113?
Mark = x,. Don = 3x + 1 x + 3x + 1 = 113 4x = 112, x = 28 Mark = 28, Don = 85, 28 + 85 = 113
Pawel
how do I set up the problem?
what is a solution set?
Harshika
find the subring of gaussian integers?
Rofiqul
hello, I am happy to help!
please can go further on polynomials quadratic
Abdullahi
hi mam
Mark
I need quadratic equation link to Alpa Beta
find the value of 2x=32
divide by 2 on each side of the equal sign to solve for x
corri
X=16
Michael
Want to review on complex number 1.What are complex number 2.How to solve complex number problems.
Beyan
yes i wantt to review
Mark
use the y -intercept and slope to sketch the graph of the equation y=6x
how do we prove the quadratic formular
Darius
hello, if you have a question about Algebra 2. I may be able to help. I am an Algebra 2 Teacher
thank you help me with how to prove the quadratic equation
Seidu
may God blessed u for that. Please I want u to help me in sets.
Opoku
what is math number
4
Trista
x-2y+3z=-3 2x-y+z=7 -x+3y-z=6
can you teacch how to solve that🙏
Mark
Solve for the first variable in one of the equations, then substitute the result into the other equation. Point For: (6111,4111,−411)(6111,4111,-411) Equation Form: x=6111,y=4111,z=−411x=6111,y=4111,z=-411
Brenna
(61/11,41/11,−4/11)
Brenna
x=61/11 y=41/11 z=−4/11 x=61/11 y=41/11 z=-4/11
Brenna
Need help solving this problem (2/7)^-2
x+2y-z=7
Sidiki
what is the coefficient of -4×
-1
Shedrak
the operation * is x * y =x + y/ 1+(x × y) show if the operation is commutative if x × y is not equal to -1
A soccer field is a rectangle 130 meters wide and 110 meters long. The coach asks players to run from one corner to the other corner diagonally across. What is that distance, to the nearest tenths place.
Jeannette has $5 and$10 bills in her wallet. The number of fives is three more than six times the number of tens. Let t represent the number of tens. Write an expression for the number of fives.
What is the expressiin for seven less than four times the number of nickels
How do i figure this problem out.
how do you translate this in Algebraic Expressions
why surface tension is zero at critical temperature
Shanjida
I think if critical temperature denote high temperature then a liquid stats boils that time the water stats to evaporate so some moles of h2o to up and due to high temp the bonding break they have low density so it can be a reason
s.
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
Got questions? Join the online conversation and get instant answers!