Comments (5)
Hello @fanyimeng0,
I am pasting the contents of your report below for visibility.
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import time
# Import Sionna RT components
from sionna.rt import load_scene, Transmitter, Receiver, PlanarArray, Camera
# For link-level simulations
from sionna.channel import cir_to_ofdm_channel, subcarrier_frequencies, OFDMChannel, ApplyOFDMChannel, CIRDataset
from sionna.nr import PUSCHConfig, PUSCHTransmitter, PUSCHReceiver
from sionna.utils import compute_ber, ebnodb2no, PlotBER
from sionna.ofdm import KBestDetector, LinearDetector
from sionna.mimo import StreamManagement
import os
gpu_num = 0 # Use "" to use the CPU
os.environ["CUDA_VISIBLE_DEVICES"] = f"{gpu_num}"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
# Import Sionna
try:
import sionna
except ImportError as e:
# Install Sionna if package is not already installed
import os
os.system("pip install sionna")
import sionna
# Load the required Sionna components
from sionna.nr import PUSCHConfig, PUSCHTransmitter, PUSCHReceiver
from sionna.channel import AWGN, RayleighBlockFading, OFDMChannel, TimeChannel, time_lag_discrete_time_channel
from sionna.channel.tr38901 import AntennaArray, UMi, UMa, RMa
from sionna.channel import gen_single_sector_topology as gen_topology
from sionna.utils import compute_ber, ebnodb2no, sim_ber
from sionna.ofdm import KBestDetector, LinearDetector
from sionna.mimo import StreamManagement
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import sys
from sionna.utils import BinarySource, QAMSource, ebnodb2no, compute_ser, compute_ber, PlotBER
from sionna.channel import FlatFadingChannel, KroneckerModel
from sionna.channel.utils import exp_corr_mat
from sionna.mimo import lmmse_equalizer
from sionna.mapping import SymbolDemapper, Mapper, Demapper
from sionna.fec.ldpc.encoding import LDPC5GEncoder
from sionna.fec.ldpc.decoding import LDPC5GDecoder
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pickle
import time
from sionna.mimo import StreamManagement
from sionna.ofdm import ResourceGrid, ResourceGridMapper, LSChannelEstimator, LMMSEEqualizer
from sionna.ofdm import OFDMModulator, OFDMDemodulator, ZFPrecoder, RemoveNulledSubcarriers
from sionna.channel.tr38901 import AntennaArray, CDL, Antenna
from sionna.channel import subcarrier_frequencies, cir_to_ofdm_channel, cir_to_time_channel, time_lag_discrete_time_channel
from sionna.channel import ApplyOFDMChannel, ApplyTimeChannel, OFDMChannel, TimeChannel
from sionna.fec.ldpc.encoding import LDPC5GEncoder
from sionna.fec.ldpc.decoding import LDPC5GDecoder
from sionna.mapping import Mapper, Demapper
from sionna.utils import BinarySource, ebnodb2no, sim_ber
from sionna.utils.metrics import compute_ber
import tensorflow as tf
# Configure the notebook to use only a single GPU and allocate only as much memory as needed
# For more details, see https://www.tensorflow.org/guide/gpu
gpus = tf.config.list_physical_devices('GPU')
if gpus:
try:
tf.config.experimental.set_memory_growth(gpus[0], True)
except RuntimeError as e:
print(e)
# Avoid warnings from TensorFlow
tf.get_logger().setLevel('ERROR')
scene = load_scene("../test_bg/test.xml")
scene.remove("tx")
scene.remove("rx")
scene.tx_array = PlanarArray(num_rows=1,
num_cols=1,
vertical_spacing=0.5,
horizontal_spacing=0.5,
pattern="tr38901",
polarization="V")
# Configure antenna array for all receivers
scene.rx_array = PlanarArray(num_rows=9,
num_cols=9,
vertical_spacing=0.5,
horizontal_spacing=0.5,
pattern="tr38901",
polarization="V")
# Create transmitter
tx = Transmitter(name="tx",
position=[0,-10,17])
# Add transmitter instance to scene
scene.add(tx)
# Create a receiver
rx = Receiver(name="rx",
position=[0,-10,17],
orientation=[0,0,0])
# Add receiver instance to scene
scene.add(rx)
#tx.look_at(rx) # Transmitter points towards receiver
scene.frequency = 2.6e9 # in Hz; implicitly updates RadioMaterials
scene.synthetic_array = True # If set to False, ray tracing will be done per antenna element (slower for large arrays)
# Compute propagation paths
paths = scene.compute_paths(max_depth=2,
num_samples=1e6) # Number of rays shot into directions defined
# by a Fibonacci sphere , too few rays can
# lead to missing paths
# Visualize paths in the 3D preview
a, tau = paths.cir()
print("Shape of `a` after applying Doppler shifts: ", paths.a.shape)
re = np.diff(np.angle(a[0,0,:,0,0,1,0]))*180/np.pi
re[re < 0] += 360
print(re)
#scene.preview(paths, show_devices=True, show_paths=True) # Use the mouse to focus on the visualized paths
Shape of `a` after applying Doppler shifts: (1, 1, 81, 1, 1, 2, 1)
[106.611206 106.611275 106.61128 106.6113 106.61126 106.61131
106.61127 106.61126 300.78107 106.611275 106.611275 106.61127
106.61126 106.611275 106.61131 106.61127 106.61126 300.78104
106.611275 106.61131 106.61125 106.61128 106.61126 106.61133
106.61126 106.611244 300.7811 106.61124 106.6113 106.611305
106.61125 106.61127 106.611305 106.611305 106.611244 300.78104
106.61127 106.611275 106.61128 106.61125 106.61127 106.61131
106.611244 106.61127 300.78104 106.61125 106.61131 106.61128
106.61127 106.61125 106.611305 106.6113 106.611244 300.7811
106.61126 106.611275 106.6113 106.61126 106.611275 106.6113
106.611244 106.611275 300.78104 106.61126 106.6113 106.61128
106.611275 106.61126 106.6113 106.611244 106.611275 300.78107
106.611275 106.6113 106.61128 106.61126 106.6113 106.611275
106.611275 106.611206]
scene.remove("tx")
scene.remove("rx")
scene.tx_array = PlanarArray(num_rows=1,
num_cols=1,
vertical_spacing=0.5,
horizontal_spacing=0.5,
pattern="tr38901",
polarization="V")
# Configure antenna array for all receivers
scene.rx_array = PlanarArray(num_rows=9,
num_cols=9,
vertical_spacing=0.5,
horizontal_spacing=0.5,
pattern="tr38901",
polarization="V")
# Create transmitter
tx = Transmitter(name="tx",
position=[0,-10,17])
# Add transmitter instance to scene
scene.add(tx)
# Create a receiver
rx = Receiver(name="rx",
position=[0,-10,17],
orientation=[0,0,0])
# Add receiver instance to scene
scene.add(rx)
#tx.look_at(rx) # Transmitter points towards receiver
scene.frequency = 2.6e9 # in Hz; implicitly updates RadioMaterials
scene.synthetic_array = True # If set to False, ray tracing will be done per antenna element (slower for large arrays)
# Compute propagation paths
paths = scene.compute_paths(max_depth=2,
num_samples=1e6) # Number of rays shot into directions defined
# by a Fibonacci sphere , too few rays can
# lead to missing paths
# Visualize paths in the 3D preview
a, tau = paths.cir()
print("Shape of `a` after applying Doppler shifts: ", paths.a.shape)
re = np.diff(np.angle(a[0,0,:,0,0,1,0]))*180/np.pi
re[re < 0] += 360
print(re)
#scene.preview(paths, show_devices=True, show_paths=True) # Use the mouse to focus on the visualized paths
Shape of `a` after applying Doppler shifts: (1, 1, 81, 1, 1, 2, 1)
[143.51534 143.51512 143.51521 143.51517 143.51523 143.51517
143.51524 143.51515 31.051336 143.51517 143.51517 143.5152
143.51518 143.5152 143.51518 143.51526 143.51515 31.051294
143.51517 143.51517 143.51523 143.5152 143.51521 143.51518
143.51524 143.51518 31.05131 143.51524 143.51508 143.51523
143.5152 143.51521 143.51517 143.51526 143.51515 31.05129
143.51521 143.51518 143.5152 143.5152 143.51521 143.51517
143.51526 143.51517 31.051292 143.51517 143.51521 143.5152
143.51518 143.5152 143.51515 143.51521 143.51517 31.051323
143.51518 143.5152 143.51518 143.51521 143.5152 143.51518
143.51527 143.5151 31.05133 143.51521 143.51518 143.51518
143.51521 143.51517 143.5152 143.51529 143.51517 31.051224
143.51521 143.51518 143.5152 143.51523 143.51517 143.51517
143.51529 143.51521 ]
from sionna.
Hi @fanyimeng0,
I was trying to look into your issue but I do not have access to the scene that you are using.
Could you please provide a minimal code example reproducing the issue, using one of the scenes integrated with Sionna?
from sionna.
Hello,I reproduced this issue in sionna.rt.scene.munich. The third code cell in the Jupyter notebook is the same as the second one. I'm running the same code twice to demonstrate that the same code can lead to different results. The printed results are the phase difference between antennas.
`a, tau = paths.cir()
print("Shape of a
: ", paths.a.shape)
re = np.diff(np.angle(a[0,0,:,0,0,1,0]))*180/np.pi
re[re < 0] += 360
print(re)`
And the attacked file is the result in munich scene.
RTtest.md
from sionna.
Related Issues (20)
- Sionna RT: question on scatt random phases HOT 4
- Errors when using materials different than itu_concrete HOT 2
- confused on perfect CSI simulation result HOT 4
- How to calculate the refracted electromagnetic field HOT 1
- sionnaRT: slow GPU computation times HOT 8
- Hello World Example in 5G NR PUSCH Tutorial does not take channel into account. HOT 2
- New Radiation Pattern HOT 2
- Error when using interferers in end-to-end PUSCH Simulations model HOT 1
- Channel Impulse Response unexpected values HOT 5
- Channel Impulse Response moving scenario
- How do I customize the pattern of an antenna? HOT 1
- How to Retrieve Reflection Coefficients and Determine Amplitude Attenuation in Sionna Ray Tracer
- Mobility notebook crashes on Google Colab with CPU runtime
- Only import sionna and mitsuba work on Mac and on Arm N1, mitsuba is not even compiling. HOT 2
- In NR PUSCH the longer CP is applied to the first slot in frame instead of first symbol in slot HOT 1
- Error when using @tf.function in release 0.17.0 HOT 1
- Question about channel estimation HOT 1
- How to optimize antenna position using sionna RT HOT 1
- Review required for my pull request #430 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sionna.