- #1
btb4198
- 572
- 10
ok I am new to Brown Noise and DSP
but from I read this is how you would do it :
is that right?
Brown noise you do add the last number with the new number right ?
also
samplecount = 13230;
offset = 0;
but from I read this is how you would do it :
Code:
class BrownNoise : WaveProvider32
{
double T;
int N;
double dt;
Random rand1;
float lastValue;
public BrownNoise()
{
T = 1;
rand1 = new Random();
}
public override int Read(float[] buffer, int offset, int sampleCount)
{
buffer[0] = 0;
lastValue =0;
dt = T / (double)sampleCount;
for (int i = 1 ; i < sampleCount; i++)
{
float temp = (float)(Math.Sqrt(dt)*rand1.Next(255));
buffer[i] = lastValue + temp;
lastValue = temp;
}
return sampleCount;
}
is that right?
Brown noise you do add the last number with the new number right ?
also
samplecount = 13230;
offset = 0;