Comments (5)
Remove cusignal.firwin() in synthetic.py, https://github.com/TorchDSP/torchsig/blob/main/torchsig/datasets/synthetic.py#L1017
if self.use_gpu:
taps = cusignal.firwin(
num_taps,
cutoff_frequency,
width=transition_bandwidth,
window=sp.get_window("blackman", num_taps),
scale=True,
fs=sample_rate,
)
from torchsig.
Replace cupy convolve: https://github.com/TorchDSP/torchsig/blob/main/torchsig/datasets/synthetic.py#L391
filtered = xp.convolve(
xp.array(zero_padded), xp.array(self.pulse_shape_filter), "same"
)
from torchsig.
Cupy in OFDM modulator: https://github.com/TorchDSP/torchsig/blob/main/torchsig/datasets/synthetic.py
Line 390:
xp = cp if self.use_gpu else np
ofdm_symbols = xp.fft.ifft(xp.fft.ifftshift(zero_pad, axes=0), axis=0)
symbol_dur = ofdm_symbols.shape[0]
cyclic_prefixed = xp.pad(
ofdm_symbols, ((int(cyclic_prefix_len), 0), (0, 0)), "wrap"
)
Line 751:
output = xp.convolve(xp.array(flattened), xp.array(self.taps), mode="same")[
Line 770:
output = xp.convolve(xp.array(flattened), xp.array(taps), mode="same")[
Line 779:
windowed = xp.pad(
cyclic_prefixed,
((half_window_len, half_window_len), (0, 0)),
"constant",
constant_values=0,
)
Line 802:
windowed = xp.pad(
cyclic_prefixed,
((0, int(window_len)), (0, 0)),
"constant",
constant_values=0,
)
Line 819:
front_window = xp.blackman(int(window_len * 2))[: int(window_len)].reshape(
Line 822:
tail_window = xp.blackman(int(window_len * 2))[-int(window_len) :].reshape(
Line 832:
combined = xp.zeros((windowed.shape[0] * windowed.shape[1],), dtype=complex)
Line 843:
output = xp.asnumpy(output) if self.use_gpu else output
from torchsig.
Cupy in FSK modulator in synthetic.py:
Line 976:
xp = cp if self.use_gpu else np
Line 979:
symbols_repeat = xp.repeat(symbols, samples_per_symbol_recalculated)
Line 985:
filtered = xp.convolve(xp.array(symbols_repeat), xp.array(taps), "same")
Line 994:
phase = xp.cumsum(xp.array(filtered) * 1j * mod_idx * np.pi)
modulated = xp.exp(phase)
Line 1035:
modulated = xp.convolve(xp.array(modulated), xp.array(taps), mode="same")
Line 1037:
modulated = xp.asnumpy(modulated) if self.use_gpu else modulated
Line 1044:
def _gaussian_taps(self, samples_per_symbol, BT: float = 0.35) -> np.ndarray:
xp = cp if self.use_gpu else np
# pre-modulation Bb*T product which sets the bandwidth of the Gaussian lowpass filter
M = 4 # duration in symbols
n = xp.arange(-M * samples_per_symbol, M * samples_per_symbol + 1)
p = xp.exp(
-2 * np.pi2 * BT2 / np.log(2) * (n / float(samples_per_symbol)) ** 2
)
p = p / xp.sum(p)
return p
from torchsig.
Following is a summary of the cupy and cusignal calls. However, all functions may not need to be done on GPU. Most likely candidates for GPU acceleration are:
- cupy.convolve()
- cupy.fft.ifft()
The following may be able to be run on CPU, unclear if GPU acceleration needed:
- cupy.cumsum()
- cusignal.firwin()
- cupy.asarray()
- cupy.fft.ifftshift()
- cupy.pad()
- cupy.blackman()
- cupy.zeros()
- cupy.repeat()
- cupy.arange()
- cupy.exp()
- cupy.sum()
from torchsig.
Related Issues (20)
- Documentation Generation Fails "NameError: name '_C' is not defined"
- No Documentation for Creation of All Pretrained Models Found at https://torchsig.com/dist/downloads.html
- Quantize() to have broader range of levels HOT 1
- MDB_MAP_FULL trying to generate_sig53 HOT 3
- XCiT not working with different num_classes HOT 1
- Documentation on signal parameters for signal generation and create user friendly section to change parameters.
- Add np.kaiser window to spectrogram function
- Question about cupy and torch
- "pip install ." does not work with Python 3.10.12
- DescToBBoxSignalDict creates incorrect box. HOT 2
- iq_imbalance: dc offset is not calculated properly
- The problem of correspondence between the label of the spectrum chart and the mask coordinates
- Pretrianed models perform poorly
- Some signals seem to be divided into two parts HOT 1
- No documentation of creation for pre-trained models
- Invalid argument for DatasetCreator().__init__()
- NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash; .../examples/00_example_sig53_dataset.ipynb HOT 2
- Can't load pretrained models anymore HOT 10
- len(sig53) | .../example/01_example_modulations_dataset.ipynb creates data.mdb file , but with zero items (len=0)
- pytest > collected 125 items / 1 error ; ImportError: cannot import name 'SignalDescription'
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 torchsig.