Replies: 1 comment 1 reply
-
Hello! Regarding BPSK and QPSK: It is really straightforward to create a modulation object and modulate bits. For example: >>> qpsk = komm.PSKModulation(4)
>>> bits = [0, 0, 1, 0, 1, 1, 0, 1]
>>> symbols = qpsk.modulate(bits)
>>> print(np.around(symbols, decimals=6))
array([ 1.+0.j, 0.+1.j, -1.+0.j, -0.-1.j]) Or, perhaps you meant to generate a waveform? pulse = komm.RectangularPulse()
sps = 200 # Samples per symbol (samples/symbol)
tx_filt = komm.TransmitFilter(pulse, samples_per_symbol=sps)
fc = 20e3 # Carrier frequency [Hz]
Rs = 5e3 # Symbol rate [symbols/s]. This will give 4 cycles of the carrier per symbol
samp_rate = sps * Rs # Sampling rate [samples/s]
Nt = symbols.size * sps # Number of samples in the transmitted signal
t = np.arange(Nt) / samp_rate # Time vector [s]
x_bb = tx_filt(symbols.real) + 1j * tx_filt(symbols.imag) # Baseband signal
x_bp = np.real(x_bb * np.exp(1j * 2 * np.pi * fc * t)) # Passband signal
plt.grid(True)
plt.plot(t, x_bp)
plt.xticks(np.arange(symbols.size + 1) / Rs)
plt.show() In this case I admit it is not that straightforward. Do you believe a helper function would be beneficial? Regarding MSK: The library currently does not support any form of FSK modulation. However, this certainly falls within the scope of this project. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It appears that things are heavily abstracted in this library? I'd expect a quick way to make BPSK or QPSK, for example, without going to a generalized form and feeding it the specific parameters. It's cool to be general under the hood, but some helpers would be nice for those of us just learning how to use it. Anyway, is MSK possible, and is there example code somewhere for easy stuff like QPSK? Sorry of these are dumb questions.
Beta Was this translation helpful? Give feedback.
All reactions