Replies: 4 comments
-
Hi, The phases are random between different runs if you do not set the random seed explicitly. Below is a code example that shows this behaviour. Concerning the corollary question, yes, the diffuse reflection simply does not incur any phase shift at all in this case so that the resulting phase shift is a combination of the delay as well as possible phase shifts in specular reflections prior to the diffuse reflection. #Load scene
scene = load_scene(sionna.rt.scene.simple_street_canyon)
# Assign scattering coefficient
for rm in scene.radio_materials.values():
rm.scattering_coefficient = 1/np.sqrt(3)
# Configure TX and RX
scene.tx_array = PlanarArray(num_rows=1,
num_cols=1,
vertical_spacing=0.5,
horizontal_spacing=0.5,
pattern="iso",
polarization="V")
scene.rx_array = scene.tx_array
scene.add(Transmitter(name="tx",
position=[-33,11,32],
orientation=[0,0,0]))
scene.add(Receiver(name="rx",
position=[27,-13,1.5],
orientation=[0,0,0]))
# Set random seed
tf.random.set_seed(1)
paths = scene.compute_paths(max_depth=3,
num_samples=1e6,
scattering=True, reflection=False, los=False, scat_keep_prob=1)
a, tau = paths.cir()
# Set the same random seed (results should be identical)
tf.random.set_seed(1)
paths = scene.compute_paths(max_depth=3,
num_samples=1e6,
scattering=True, reflection=False, los=False, scat_keep_prob=1)
a2, tau2 = paths.cir()
print(np.array_equal(a, a2))
# Set different random seed (results should be different)
tf.random.set_seed(2)
paths = scene.compute_paths(max_depth=3,
num_samples=1e6,
scattering=True, reflection=False, los=False, scat_keep_prob=1)
a3, tau3 = paths.cir()
print(np.array_equal(a, a3)) |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response. I discovered a 'tf.random.set_seed(1)' in my script. This explains my problem. Issue solved then When I set set scat_random_phases to False, , I get only real values of the amplitudes. this indicates that there is no dependency on the scattering surface, neither the propagation delay This is not a big deal for my application, as I am interested in random phases |
Beta Was this translation helpful? Give feedback.
-
Are you looking at the passband or baseband impulse response? The phase shift due to the propagation delay is visible in the complex baseband (see Eqn. (28)). I also imagine that you only look at paths which have undergone a single diffuse reflection. If there was at least a specular reflection prior to the scattering, you would also see a phase shifts due to the reflection. |
Beta Was this translation helpful? Give feedback.
-
I have not touched at the CIR so far. I just used paths.a (which are complex values. I have only scattered paths with a single interaction with the target, and no diffraction in my current setup. Random phases result in complex values). |
Beta Was this translation helpful? Give feedback.
-
I have set scat_random_phases to True in my script, but it looks like the same random values are generated across different runs. Is there a way to generate truly random values for each run ?
A corollary question: I have also tried with scat_random_phases=False, How are the phases calculated in that case, do they only depend on the ToF, assuming a zero phase shift when they reflect on the target ?
Beta Was this translation helpful? Give feedback.
All reactions