Skip to content

Commit

Permalink
Code quality improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidXH committed Nov 2, 2024
1 parent b2efaa2 commit 3560d71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cavern.QuickEQ/SignalGeneration/WaveformGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Cavern.QuickEQ.SignalGeneration {
/// <summary>
/// Generates various signals.
/// </summary>
public class WaveformGenerator {
public static class WaveformGenerator {
/// <summary>
/// Generates a sine wave signal.
/// </summary>
Expand Down Expand Up @@ -48,7 +48,7 @@ public static float[] PinkNoise(int length, int sampleRate) {
float[] result = WhiteNoise(workingLength);
Equalizer eq = new Equalizer();
const double startFreq = 10;
double nyquist = sampleRate / 2;
double nyquist = sampleRate / 2.0;
eq.AddBand(new Band(startFreq, 0));
// Pink noise bands lose 3 dB/octave, which is 10 dB/decade
eq.AddBand(new Band(nyquist, -10 * Math.Log(nyquist) / Math.Log(startFreq)));
Expand Down

0 comments on commit 3560d71

Please sign in to comment.