edsonportosilva / OptiCommPy

Simulate optical communications systems with Python.
https://opticommpy.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
110 stars 40 forks source link

About OOK pulses & spectrum #14

Closed JefFan4YC closed 1 year ago

JefFan4YC commented 1 year ago

Hi, @edsonportosilva

I'm testing the basic_OOK codes shown in the ./examples, and the figures seem like:

image

Such results, unlike the preview in basic_OOK_transmission notebook, show a different pulse shaping method leading to abnormal spectrum.

image

With no revision of original codes, I guess it comes from an alternative PulseShape in the up-to-date version. May I know some tips to solve this? Thanks.

JefFan4YC commented 1 year ago

Ah, I figure out it's the pnorm from optic.dsp leading to this variation. Might be necessary to update it to show the notebook results. However, spectral spikes are still visible in the FFT.

edsonportosilva commented 1 year ago

Hello @JefFan4YC,

This notebook will be changed in an upcoming update of the repository. The issue is that modulateGray(bitsTx, M, 'ook') should be modulateGray(bitsTx, M, 'pam') instead because it is generating the binary electrical signal that will drive the MZM. The MZM expects a binary electrical signal with no DC level, which is not the case in the current notebook, since the symbols are generated already as 'ook'. This is the cause of the problem, not pnorm.

JefFan4YC commented 1 year ago

@edsonportosilva Yes, it seems a proper NRZ signal for MZM input is necessary. Again, thanks for your help and looking forward to the new update!