noise curve in excel

spanikakamuni

New Member
Joined
Apr 5, 2016
Messages
5
Hello,
I am very new to excel.
I want to create a noise curve with a crest factor of 5 using excel. My frequency(1/T) range is 100khertz to 220Mhertz.
i normally used Norm.inv(RAND(),0,1) to make some random voltages for my curve.
but now i am asked to consider a crest factor of 5 for each voltage point i make on my curve. I am really confused. how can i make it work.
thanking you,
spanika kamuni
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi and welcome to the MrExcel Message Board.

The Crest Factor is the maximum peak height divided by the RMS value. The way you are generating your samples at present seems to give varying crest factors of between 3.7 and 4.6. I based that on about 20,000 samples. The variation will be greater if you use fewer samples. So it is possible that some of your samples may already have a crest factor of 5.

Changing the crest factor is easy, you can start from the signal you already have and raise it to a power of some number. That is only one method and may not be what is being sought.

The main problem is how you limit the frequency range. Do you perform any filtering on the data at present? If not then the signal may well have components outside your requested range. I don't know if that is an issue for you.

Here is the start of the data I looked at. Obviously, I have omitted most of the rows but it will show you what I did.
I used the MAX function to find the peak and the STDDEV function to find the RMS value. Then divided one by the other to get the crest factor. That is displayed in row 3. I added a sine wave to make sure the figures were working out as I expected. (Sine waves have crest factors of 1.414 i.e. SQRT(2).)

The data in column B is your original formula and the data in column C is that data which has been made more "peaky".


Cell Formulas
RangeFormula
B1=MAX(B5:B20004)
B2=STDEV.P(B5:B20004)
B3=B1/B2
B5= NORM.INV(RAND(),0,1)
B6= NORM.INV(RAND(),0,1)
B7= NORM.INV(RAND(),0,1)
B8= NORM.INV(RAND(),0,1)
B9= NORM.INV(RAND(),0,1)
B10= NORM.INV(RAND(),0,1)
B11= NORM.INV(RAND(),0,1)
B12= NORM.INV(RAND(),0,1)
B13= NORM.INV(RAND(),0,1)
B14= NORM.INV(RAND(),0,1)
B15= NORM.INV(RAND(),0,1)
B16= NORM.INV(RAND(),0,1)
B17= NORM.INV(RAND(),0,1)
C1=MAX(C5:C20004)
C2=STDEV.P(C5:C5004)
C3=C1/C2
C5=SIGN(B5)*(ABS(B5)^$A$1)
C6=SIGN(B6)*(ABS(B6)^$A$1)
C7=SIGN(B7)*(ABS(B7)^$A$1)
C8=SIGN(B8)*(ABS(B8)^$A$1)
C9=SIGN(B9)*(ABS(B9)^$A$1)
C10=SIGN(B10)*(ABS(B10)^$A$1)
C11=SIGN(B11)*(ABS(B11)^$A$1)
C12=SIGN(B12)*(ABS(B12)^$A$1)
C13=SIGN(B13)*(ABS(B13)^$A$1)
C14=SIGN(B14)*(ABS(B14)^$A$1)
C15=SIGN(B15)*(ABS(B15)^$A$1)
C16=SIGN(B16)*(ABS(B16)^$A$1)
C17=SIGN(B17)*(ABS(B17)^$A$1)
D1=MAX(D5:D20004)
D2=STDEV.P(D5:D5004)
D3=D1/D2
D5=SQRT(2)*SIN(A5/10)
D6=SQRT(2)*SIN(A6/10)
D7=SQRT(2)*SIN(A7/10)
D8=SQRT(2)*SIN(A8/10)
D9=SQRT(2)*SIN(A9/10)
D10=SQRT(2)*SIN(A10/10)
D11=SQRT(2)*SIN(A11/10)
D12=SQRT(2)*SIN(A12/10)
D13=SQRT(2)*SIN(A13/10)
D14=SQRT(2)*SIN(A14/10)
D15=SQRT(2)*SIN(A15/10)
D16=SQRT(2)*SIN(A16/10)
D17=SQRT(2)*SIN(A17/10)
 
Upvote 0
Oh, I forgot ...


The value in A1 is an arbitrary factor.

If you set it to 1 then you will get a copy of your usual data in column C.
If you make A1 bigger it will increase the Crest Factor.

Because you are using a Normal Distribution you need a lot of samples to make the numbers repeatable.
 
Upvote 0
Oh, I forgot ...
The value in A1 is an arbitrary factor.

If you set it to 1 then you will get a copy of your usual data in column C.
If you make A1 bigger it will increase the Crest Factor.

Because you are using a Normal Distribution you need a lot of samples to make the numbers repeatable.



Thank you very much. your Information helped me a lot.
for now I put the frequency aside. i made 65535 (16 bit)samples.
I understand that crest factor is Peak/rms value in electronic Terms. but in Excel how are we doing it. i really dont understand. can you please explain it a bit more.
I didnot understand the formula used in 'new column'. can you expand a Little more on it.

I have one more Question.
My Supervisor asks me to make the x axis to have 65535 samples.
make y axis with voltages of (16 bit) and having crest factor 5 without using rand function and then jumble the numbers. I really dont understand what he meant by this.
 
Upvote 0
I have one more doubt. I should have a dc Offset as Zero when i make a crest factor of 5 since i am feeding this Signal into a transformer. how is this posible. I mean i dont understand how this Statement is taken into consideration when making a curve in Excel.
 
Upvote 0
I understand that crest factor is Peak/rms value in electronic Terms. but in Excel how are we doing it. i really dont understand. can you please explain it a bit more.
If you want an over view of "peakiness" you might take a look here: https://en.wikipedia.org/wiki/Kurtosis
Kurtosis is how a statistician measures it.

From a time series point of view, the peak value is obviously the maximum value and the rms value is related to the area under the curve. So to make a signal more "peaky" you need to increase its maximum value and reduce the area under the curve.

If you imagine starting with a sine wave, you could pinch each half cycle to make it narrower but have a higher peak. That would increase its crest factor and its Kurtosis. So I just used the first idea that popped into my head that would do that to your data.

I didnot understand the formula used in 'new column'. can you expand a Little more on it.
If you have a positive number less than 1, if you square it you will get an even smaller number.
On the other hand, if you have a number larger than 1 then when you square it the number will become bigger.
So, if you have positive numbers some less than 1 and some more than 1 if you square them all you will stretch the numbers out. This is like "pinching" the sine wave as suggested above.

If you raise the numbers to the power of one instead there will be no change. A power less than one will make the waveform "fatter" while numbers above one will make them thinner or peakier.

Try plotting out the data below and then changing the value in call A1. You will see how the Y2 curve varies.


Excel 2013
ABCD
12Max:1.11.21
2StdDev:0.3452050.394099
3Average:0.550.421667
4RMS:0.8952050.815765
5Crest Fac:1.2287681.483269
6Kurtosis:-1.21569-0.75921
7XY1Y2
8000
910.10.01
1020.20.04
1130.30.09
1240.40.16
1350.50.25
1460.60.36
1570.70.49
1680.80.64
1790.90.81
181011
19111.11.21
201200
21130.10.01
22140.20.04
23150.30.09
24160.40.16
25170.50.25
26180.60.36
27190.70.49
28200.80.64
29210.90.81
302211
31231.11.21
Sheet2
Cell Formulas
RangeFormula
C1=MAX(Sheet2!$C$8:$C$31)
C2=STDEV.P(Sheet2!$C$8:$C$31)
C3=AVERAGE(Sheet2!$C$8:$C$31)
C4=C3+C2
C5=C1/C4
C6=KURT(Sheet2!$C$8:$C$31)
D1=MAX(Sheet2!$D$8:$D$31)
D2=STDEV.P(Sheet2!$D$8:$D$31)
D3=AVERAGE(Sheet2!$D$8:$D$31)
D4=D3+D2
D5=D1/D4
D6=KURT(Sheet2!$D$8:$D$31)
D8=Sheet2!$C8^$A$1
 
Upvote 0
I have one more doubt. I should have a dc Offset as Zero when i make a crest factor of 5 since i am feeding this Signal into a transformer. how is this posible. I mean i dont understand how this Statement is taken into consideration when making a curve in Excel.

If you need a zero dc offset then you need to make sure that the average value is zero.

I assumed it was in my original answer but in the one above I have added in the average value to the calculation and included that in the rms value calculation. That was mainly because I was going to use a signal with a positive dc offset in my example.
 
Upvote 0
There is another issue when thinking about "zero offsets" and my original formula. Raising negative numbers to powers is not quite so easy as doing it with positive ones. So I made sure that I only did it with positive ones.

=B5^1.2
will work if B5 is positive but will fail if B5 is negative. So I split the sign away from the number, applied the power to the positive (ABS) part then re-applied the sign afterwards.

=SIGN(B5)*(ABS(B5)^$A$1)

I hope that makes sense.

=================================

Another problem is what to do about ensuring a 16-bit signal.

16 bits means that the signal can have no more than 256 separate levels because 2^16 = 256.
Be careful because there is a gotcha here if you need zero dc offset. If you use 1 to 128 for the positive numbers and -1 to 127 for negative numbers that introduces a slight bias in the positive direction. How you process the data depends on what you want to do about zero. Probably the easiest thing is to keep zero as zero then use only -127 to +127 and forget about +128.

=================================

If you need to create 65536 numbers in a random order then create the numbers, add a column with random numbers in it then sort the whole lot by the random number.

=================================

Also remember that if you are using signals with no dc offset then they will swing plus and minus so when you work out the peak value you will need to take into account the negative peaks. One way to do that is:
=MAX(MAX(A1:A65536),ABS(MIN(A1:A65536)))
but there are lots of ways to do that.

=================================

Regards,
 
Upvote 0

Forum statistics

Threads
1,215,847
Messages
6,127,264
Members
449,372
Latest member
charlottedv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top