Creating Brown Noise with WaveProvider32 in C#

  • Thread starter Thread starter btb4198
  • Start date Start date
  • Tags Tags
    Noise
AI Thread Summary
The discussion focuses on creating Brown Noise using C# and the WaveProvider32 class. A sample code implementation is provided, which initializes parameters and generates noise by adding the last value to a new random value in the Read method. The user seeks confirmation on the correctness of their approach, specifically regarding the addition of the last number with the new number to produce Brown Noise. They also mention specific values for sample count and offset. The conversation highlights the need for further insights or corrections from more experienced developers in DSP.
btb4198
Messages
570
Reaction score
10
ok I am new to Brown Noise and DSP
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;
 
Engineering news on Phys.org
I'm sorry you are not generating any responses at the moment. Is there any additional information you can share with us? Any new findings?
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top