Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

## Dependencies

* None
* NumPy
* SciPy

## Installing

Expand Down
23 changes: 13 additions & 10 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to PyModulation's documentation!
========================================
PyModulation Library Documentation
==================================

.. toctree::
:maxdepth: 2
:caption: Contents:
TODO

The project is fully open source and is available in a `GitHub repository <https://github.com/mgm8/pymodulation>`_. All contributions are welcome! If you found a bug, developed a new feature, or want to improve the documentation, there are two ways to do so: open an issue describing the suggested modification, or by opening a pull request. More information are available in the `CONTRIBUTING file <https://github.com/mgm8/pymodulation/blob/main/CONTRIBUTING.md>`_.

Any questions or suggestions can also be addressed to Gabriel Mariano Marcelino <`gabriel.mm8@gmail.com <mailto:gabriel.mm8@gmail.com>`_>.

Contents
========

Indices and tables
==================
.. toctree::
:maxdepth: 2

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
overview
modulations
usage
17 changes: 17 additions & 0 deletions docs/modulations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
***********
Modulations
***********

GFSK
====

Gaussian Frequency Shift Keying (GFSK) is a modulation technique derived from Frequency Shift Keying (FSK), where digital data is transmitted by shifting the carrier frequency between discrete values. Unlike traditional FSK, GFSK applies a Gaussian filter to the baseband pulses before modulation, which smooths the phase transitions and reduces spectral bandwidth. This filtering minimizes abrupt frequency changes, resulting in a more compact power spectrum and reduced interference with adjacent channels. GFSK is particularly advantageous in wireless communication systems where efficient bandwidth utilization and low power consumption are critical.

One of the most notable applications of GFSK is in Bluetooth technology, where it is used for its robustness and spectral efficiency. The Gaussian filtering helps mitigate intersymbol interference (ISI) and improves performance in noisy environments. Additionally, GFSK supports both coherent and non-coherent detection, offering flexibility in receiver design. Its constant envelope property ensures efficient power amplifier operation, making it suitable for battery-powered devices. Overall, GFSK strikes a balance between simplicity, spectral efficiency, and reliability, making it a popular choice for short-range wireless communication systems.

GMSK
====

Gaussian Minimum Shift Keying (GMSK) is a continuous-phase modulation scheme derived from Frequency Shift Keying (FSK), where the digital signal is filtered using a Gaussian filter before modulation. This filtering smooths the phase transitions, resulting in a nearly constant envelope and significantly reduced spectral sidelobes compared to traditional FSK. The key feature of GMSK is its ability to achieve high spectral efficiency while maintaining low out-of-band emissions, making it ideal for bandwidth-constrained wireless systems.

A notable application of GMSK is in the Global System for Mobile Communications (GSM), where it was chosen for its robustness against interference and efficient use of available spectrum. The modulation's constant envelope allows for the use of highly efficient nonlinear power amplifiers, reducing power consumption in mobile devices. Additionally, GMSK's resistance to multipath fading and phase noise enhances performance in challenging radio environments. Despite its slightly higher complexity in demodulation compared to simpler FSK schemes, GMSK remains a widely adopted modulation technique due to its excellent balance between spectral efficiency, power efficiency, and reliability in wireless communication systems.
3 changes: 3 additions & 0 deletions docs/overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
********
Overview
********
49 changes: 49 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
*****
Usage
*****

This section presents examples of how to use the library for each supported modulation type.

GFSK
====

The GFSK modulation can be used through the *GFSK* class, using the modulate and demodulate methods. An example of usage can be seen in the code below:

.. code-block:: python

from pymodulation.gfsk import GFSK

mod = GFSK(2.5, 0.5, 9600) # Modulation index = 2.5, BT = 0.5, Baudrate = 9600 bps

data = list(range(100))

samples, fs, dur = mod.modulate(data)

print("IQ Samples:", samples[:10])

bits, bb_sig = mod.demodulate(fs, samples)

print("Demodulated bits:", list(map(int, bits)))

The *modulate* method returns the IQ samples of the generated signal, the corresponding sampling rate, and the signal duration in seconds. The *demodulate* method allows the demodulation of a GFSK signal, taking the corresponding IQ samples and sampling rate as input, and producing as output the data bitstream contained in the signal and the baseband signal samples (in NRZ format).

GMSK
====

This modulation can be used in a manner almost identical to GFSK modulation, with the difference that in this case the modulation index is fixed at 0.5, as expected for this type of modulation. An example of usage can be seen in the code below.

.. code-block:: python

from pymodulation.gmsk import GMSK

mod = GMSK(0.5, 9600) # BT = 0.5, baudrate = 9600 bps

data = list(range(100))

samples, fs, dur = mod.modulate(data)

print("IQ Samples:", samples[:10])

bits, bb_sig = mod.demodulate(fs, samples)

print("Demodulated bits:", list(map(int, bits)))
1 change: 0 additions & 1 deletion pymodulation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
#
#

from pymodulation.pymodulation import PyModulation
from pymodulation.version import __version__
Loading
Loading