(
self,
p,
fs=8000,
t0=0.0,
max_order=1,
sigma2_awgn=None,
sources=None,
mics=None,
materials=None,
temperature=None,
humidity=None,
air_absorption=False,
ray_tracing=False,
use_rand_ism=False,
max_rand_disp=0.08,
min_phase=False,
)
| 2807 | """ |
| 2808 | |
| 2809 | def __init__( |
| 2810 | self, |
| 2811 | p, |
| 2812 | fs=8000, |
| 2813 | t0=0.0, |
| 2814 | max_order=1, |
| 2815 | sigma2_awgn=None, |
| 2816 | sources=None, |
| 2817 | mics=None, |
| 2818 | materials=None, |
| 2819 | temperature=None, |
| 2820 | humidity=None, |
| 2821 | air_absorption=False, |
| 2822 | ray_tracing=False, |
| 2823 | use_rand_ism=False, |
| 2824 | max_rand_disp=0.08, |
| 2825 | min_phase=False, |
| 2826 | ): |
| 2827 | p = np.array(p, dtype=np.float32) |
| 2828 | |
| 2829 | if len(p.shape) > 1 and (len(p) != 2 or len(p) != 3): |
| 2830 | raise ValueError("`p` must be a vector of length 2 or 3.") |
| 2831 | |
| 2832 | self.dim = p.shape[0] |
| 2833 | |
| 2834 | # record shoebox dimension in object |
| 2835 | self.shoebox_dim = np.array(p) |
| 2836 | |
| 2837 | # initialize the attributes of the room |
| 2838 | self._var_init( |
| 2839 | fs, |
| 2840 | t0, |
| 2841 | max_order, |
| 2842 | sigma2_awgn, |
| 2843 | temperature, |
| 2844 | humidity, |
| 2845 | air_absorption, |
| 2846 | ray_tracing, |
| 2847 | use_rand_ism, |
| 2848 | max_rand_disp, |
| 2849 | min_phase, |
| 2850 | ) |
| 2851 | |
| 2852 | # Keep the correctly ordered naming of walls |
| 2853 | # This is the correct order for the shoebox computation later |
| 2854 | # W/E is for axis x, S/N for y-axis, F/C for z-axis |
| 2855 | self.wall_names = ["west", "east", "south", "north"] |
| 2856 | if self.dim == 3: |
| 2857 | self.wall_names += ["floor", "ceiling"] |
| 2858 | |
| 2859 | n_walls = len(self.wall_names) |
| 2860 | |
| 2861 | if materials is not None: |
| 2862 | if isinstance(materials, Material): |
| 2863 | materials = dict(zip(self.wall_names, [materials] * n_walls)) |
| 2864 | elif not isinstance(materials, dict): |
| 2865 | raise ValueError( |
| 2866 | "`materials` must be a `Material` object or " |
nothing calls this directly
no test coverage detected