TorchDSP / torchsig

TorchSig is an open-source signal processing machine learning toolkit based on the PyTorch data handling pipeline.
MIT License
170 stars 38 forks source link

DC Offset transform too large in magnitude #158

Closed MattCarrickPL closed 2 months ago

MattCarrickPL commented 1 year ago

DC offset magnitude appears to be too large in relation to noise floor & signal.

The range of values for the magnitude (in dB) of the DC offset is defined here, which is -0.1 to +0.1: https://github.com/TorchDSP/torchsig/blob/6bd7509c54242f95de60fe4f1577bf59ace2dded/torchsig/datasets/modulations.py#L220

The amplitude is calculated via https://github.com/TorchDSP/torchsig/blob/6bd7509c54242f95de60fe4f1577bf59ace2dded/torchsig/transforms/functional.py#L825

Which for the maximum value is 10**(0.1/10) = 1.02, which roughly tracks to the time domain of the example in the attached image

image

MattCarrickPL commented 1 year ago

Internal discussion resulted in the outcome that while the magnitude of the DC offset isn't practical from a DSP & RF sense, the extremeness of it is useful for training the ML algorithm so the effect will stay. However, the distribution of the magnitude needs to be log-normal such that the ML most commonly experiences practical values but it does experience extreme values but with less frequency.

MattCarrickPL commented 1 year ago

Large spike near DC may also be the result of the quantize() transform. Requires additional investigation.