39 lines
885 B
C
39 lines
885 B
C
/*
|
|
* File: modulator.h
|
|
*/
|
|
|
|
#ifndef MODULATOR_H
|
|
#define MODULATOR_H
|
|
|
|
#ifdef __XC16
|
|
#include <dsp.h>
|
|
#else
|
|
typedef int16_t fractional;
|
|
#define _Q15 _Q15sinPI(_Q15);
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include "modem.h"
|
|
|
|
typedef struct {
|
|
fractional increment;
|
|
fractional offset;
|
|
fractional gain;
|
|
} rotor_symbol;
|
|
|
|
extern rotor_symbol rotor_constellation[MAX_MODULATION_ALPHABET_SIZE];
|
|
extern rotor_symbol silence;
|
|
|
|
// buffer dei simboli
|
|
extern uint8_t tx_symbol_buffer[MAX_SYMBOL_BUFFER_SIZE];
|
|
extern uint8_t tx_symbol_buffer_index, tx_symbol_buffer_lenght;
|
|
|
|
// protoz
|
|
void modulator_setup(void);
|
|
void modulator_generate_sample_buffer(fractional *Q_buffer, fractional *I_buffer, uint8_t size, rotor_symbol symbol);
|
|
void modulator_prepare_constellation_symbols(symbol *constellation, rotor_symbol *mod_constellation);
|
|
void set_GPIO_bit(uint8_t symbol);
|
|
|
|
#endif /* MODULATOR_H */
|
|
|