|
void | DumpData (float[] data, string name) |
|
Definition at line 12 of file TestOverlapAdd.cs.
◆ DumpData()
void BGC.Tests.TestOverlapAdd.DumpData |
( |
float [] |
data, |
|
|
string |
name |
|
) |
| |
|
inlineprivate |
Definition at line 243 of file TestOverlapAdd.cs.
245 using (StreamWriter writer =
new StreamWriter($
"Stimuli/{name}.csv"))
247 foreach (
float sample
in data)
249 writer.WriteLine(sample.ToString());
◆ TestCarlileShuffler()
void BGC.Tests.TestOverlapAdd.TestCarlileShuffler |
( |
| ) |
|
|
inline |
Definition at line 72 of file TestOverlapAdd.cs.
References BGC.Audio.WaveEncoding.LoadBGCSimple(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveFile().
74 string baseFile =
"000000";
80 Debug.Log($
"Pre RMS: {Mathf.Sqrt(song.Samples.Sum(x => x * x) / song.Samples.Length)} N:{song.Samples.Length}");
82 song = song.CarlileShuffle().Cache();
84 Debug.Log($
"Post RMS: {Mathf.Sqrt(song.Samples.Sum(x => x * x) / song.Samples.Length)} N:{song.Samples.Length}");
89 channels: song.Channels,
90 samples: song.Samples,
static bool LoadBGCSimple(string filepath, out SimpleAudioClip simpleAudioClip)
Loads a WAV file from the filepath as a SimpleAudioClip, returns success.
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
static bool SaveFile(string filepath, int channels, float[] samples, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
Simplest implementation of a samplebuffer-based stream.
◆ TestNewConvolution()
void BGC.Tests.TestOverlapAdd.TestNewConvolution |
( |
| ) |
|
|
inline |
Definition at line 96 of file TestOverlapAdd.cs.
References BGC.Audio.WaveEncoding.LoadBGCStream(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
98 string baseFile =
"000000";
104 Debug.Log($
"Pre RMS: {string.Join(",
", stream.CalculateRMS().Select(x => x.ToString()).ToArray())}");
108 float[] filter1 =
new float[150];
112 float[] filter2 =
new float[150];
114 for (
int i = 0; i < 150; i++)
116 filter2[i] = 1f / Mathf.Sqrt(150);
119 IBGCStream convolved = stream.MultiConvolve(filter1, filter2);
122 string rms =
string.Join(
", ", convolved.CalculateRMS().Select(x => x.ToString()).ToArray());
124 Debug.Log($
"Post RMS: {rms}");
134 float[] filter1 =
new float[150];
135 filter1[25] = 1f / Mathf.Sqrt(2);
136 filter1[26] = 1f / Mathf.Sqrt(2);
139 float[] filter2 =
new float[150];
141 for (
int i = 0; i < 150; i++)
143 filter2[i] = 1f / 150f;
146 IBGCStream convolved = stream.MultiConvolve(filter1, filter2);
149 string rms =
string.Join(
", ", convolved.CalculateRMS().Select(x => x.ToString()).ToArray());
151 Debug.Log($
"Post RMS: {rms}");
static bool LoadBGCStream(string filepath, out IBGCStream stream)
Loads a WAV file from the filepath as a SimpleAudioClip, returns success.
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestNewFFTs()
void BGC.Tests.TestOverlapAdd.TestNewFFTs |
( |
| ) |
|
|
inline |
Definition at line 218 of file TestOverlapAdd.cs.
References BGC.Mathematics.Fourier.Forward(), and BGC.Mathematics.Fourier.Inverse().
222 for (
int i = 0; i < samples.Length; i++)
229 for (
int i = 0; i < 10; i++)
231 Debug.Log($
"{i}: {samples[i]}");
236 for (
int i = 0; i < 10; i++)
238 Debug.Log($
"{i}: {samples[i]}");
Represents a complex number with single-precision floating point components
Support for Fourier Transforms. Borrows heavily from Mathnet.Numerics.
static void Inverse(Complex32[] spectrum)
static void Forward(Complex32[] samples)
◆ TestNewSpatialization()
void BGC.Tests.TestOverlapAdd.TestNewSpatialization |
( |
| ) |
|
|
inline |
Definition at line 163 of file TestOverlapAdd.cs.
References BGC.Audio.WaveEncoding.LoadBGCStream(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
165 string baseFile =
"000000";
171 Debug.Log($
"Pre RMS: {string.Join(",
", stream.CalculateRMS().Select(x => x.ToString()).ToArray())}");
174 IBGCStream spatialized = stream.Spatialize(0f);
176 string rms =
string.Join(
", ", spatialized.CalculateRMS().Select(x => x.ToString()).ToArray());
178 Debug.Log($
"Post RMS: {rms}");
188 IBGCStream spatialized = stream.Spatialize(25f);
190 string rms =
string.Join(
", ", spatialized.CalculateRMS().Select(x => x.ToString()).ToArray());
192 Debug.Log($
"Post RMS: {rms}");
202 IBGCStream spatialized = stream.Spatialize(-25f);
204 string rms =
string.Join(
", ", spatialized.CalculateRMS().Select(x => x.ToString()).ToArray());
206 Debug.Log($
"Post RMS: {rms}");
static bool LoadBGCStream(string filepath, out IBGCStream stream)
Loads a WAV file from the filepath as a SimpleAudioClip, returns success.
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestPhaseVocoding()
void BGC.Tests.TestOverlapAdd.TestPhaseVocoding |
( |
| ) |
|
|
inline |
Definition at line 15 of file TestOverlapAdd.cs.
References BGC.Audio.SimpleAudioClip.Channels, BGC.Audio.WaveEncoding.LoadBGCSimple(), BGC.IO.DataManagement.PathForDataFile(), BGC.Audio.SimpleAudioClip.Samples, and BGC.Audio.WaveEncoding.SaveFile().
18 string baseFile =
"000000";
24 song = song.Window(10f).Cache();
29 channels: song.Channels,
30 samples: song.Samples,
static bool LoadBGCSimple(string filepath, out SimpleAudioClip simpleAudioClip)
Loads a WAV file from the filepath as a SimpleAudioClip, returns success.
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
static bool SaveFile(string filepath, int channels, float[] samples, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
Simplest implementation of a samplebuffer-based stream.
The documentation for this class was generated from the following file: