-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d5c4e5
commit b7c3c15
Showing
7 changed files
with
109 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "test_utils.h" | ||
|
||
void PrintWaveguide(dsp::Waveguide& wave, size_t delay_size) | ||
{ | ||
std::vector<float> right_samples, left_samples; | ||
for (size_t i = 1; i <= delay_size; ++i) | ||
{ | ||
float right, left; | ||
wave.TapOut(i, right, left); | ||
right_samples.push_back(right); | ||
left_samples.push_back(left); | ||
} | ||
|
||
for (auto sample : right_samples) | ||
{ | ||
printf("%5.1f ", sample); | ||
} | ||
printf("\n"); | ||
|
||
for (auto sample : left_samples) | ||
{ | ||
printf("%5.1f ", sample); | ||
} | ||
printf("\n"); | ||
} | ||
|
||
float GetWaveguideTotalEnergy(dsp::Waveguide& wave, size_t delay_size) | ||
{ | ||
float total_energy = 0.f; | ||
for (size_t i = 1; i <= delay_size; ++i) | ||
{ | ||
float right, left; | ||
wave.TapOut(i, right, left); | ||
total_energy += right * right + left * left; | ||
} | ||
|
||
return total_energy; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "waveguide.h" | ||
|
||
void PrintWaveguide(dsp::Waveguide& wave, size_t delay_size); | ||
|
||
float GetWaveguideTotalEnergy(dsp::Waveguide& wave, size_t delay_size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters