openPSTD
2.0
Open source simulation for sound propagation in urban environments
|
Measure pressure values on a fixed location in the scene. More...
#include <Receiver.h>
Public Member Functions | |
Receiver (std::vector< float > location, std::shared_ptr< PSTDSettings > config, int id, std::shared_ptr< Domain > container) | |
Initializes a receiver on coordinates (x,y,z) in grid space (not fixed to integers) More... | |
float | compute_local_pressure () |
Calculates the sound pressure at the receiver at the current time step. More... | |
Public Attributes | |
const float | x |
const float | y |
const float | z |
int | id |
std::vector< float > | location |
Unrounded (grid) location. | |
Point | grid_location |
Integer grid location. More... | |
std::vector< float > | grid_offset |
Distance from the receiver to the top left of the cell. | |
std::shared_ptr< PSTDSettings > | config |
Config file containing the receiver parameters. | |
std::shared_ptr< Domain > | container_domain |
Domain containing the receiver. | |
std::vector< float > | received_values |
Vector of observed pressure values in the receiver. | |
Measure pressure values on a fixed location in the scene.
This class measures and stores the sound pressure on each time step. Note that receiver locations (just like speaker locations) are defined on the grid, but don't need to lie on grid points; their coordinates are not rounded off. If the Receiver is not located on a grid point, the sound values are interpolated, either from the nearest grid point or using a spectral interpolation method.
OpenPSTD::Kernel::Receiver::Receiver | ( | std::vector< float > | location, |
std::shared_ptr< PSTDSettings > | config, | ||
int | id, | ||
std::shared_ptr< Domain > | container | ||
) |
Initializes a receiver on coordinates (x,y,z) in grid space (not fixed to integers)
location | float coordinates in 3D grid space. For 2D, leave z=0 |
config | Pointer to configuration object |
id | Unique receiver identifier |
container | The domain in which the receiver is located. This should not be a PML-domain. |
float OpenPSTD::Kernel::Receiver::compute_local_pressure | ( | ) |
Calculates the sound pressure at the receiver at the current time step.
Depending on config, this method uses the nearest neighbour value (fast, inaccurate) or spectral interpolation (slower, more accurate)
Point OpenPSTD::Kernel::Receiver::grid_location |
Integer grid location.
<=> Cell containing the receiver.