JS8Call-Improved master
Loading...
Searching...
No Matches
commons.h File Reference

Common definitions and constants used throughout the JS8Call-improved project. More...

#include <cstdint>
#include <mutex>
Include dependency graph for commons.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dec_data
 Global data structure used by the decoder. More...
struct  specData
 Global data structure used by the spectrum analyzer. More...
struct  hour_minute_second

Macros

#define JS8_NSPS   6192
#define JS8_NSMAX   6827
#define JS8_NTMAX   60
#define JS8_RX_SAMPLE_RATE   12000
#define JS8_RX_SAMPLE_SIZE   (JS8_NTMAX * JS8_RX_SAMPLE_RATE)
#define JS8_RING_BUFFER   1
#define JS8_DECODE_THREAD   1
#define JS8_ALLOW_EXTENDED   1
#define JS8_AUTO_SYNC   1
#define JS8_NUM_SYMBOLS   79
#define JS8_ENABLE_JS8A   1
#define JS8_ENABLE_JS8B   1
#define JS8_ENABLE_JS8C   1
#define JS8_ENABLE_JS8E   1
#define JS8_ENABLE_JS8I   1
#define JS8A_SYMBOL_SAMPLES   1920
#define JS8A_TX_SECONDS   15
#define JS8A_START_DELAY_MS   500
#define JS8B_SYMBOL_SAMPLES   1200
#define JS8B_TX_SECONDS   10
#define JS8B_START_DELAY_MS   200
#define JS8C_SYMBOL_SAMPLES   600
#define JS8C_TX_SECONDS   6
#define JS8C_START_DELAY_MS   100
#define JS8E_SYMBOL_SAMPLES   3840
#define JS8E_TX_SECONDS   30
#define JS8E_START_DELAY_MS   500
#define JS8I_SYMBOL_SAMPLES   384
#define JS8I_TX_SECONDS   4
#define JS8I_START_DELAY_MS   100

Functions

int code_time (int hour, int minute, int second)
 Encode hour, minute, and second into a single integer.
hour_minute_second decode_time (int nutc)
 Decode an integer into hour, minute, and second components.

Variables

struct dec_data dec_data
struct specData specData
std::mutex fftw_mutex

Detailed Description

Common definitions and constants used throughout the JS8Call-improved project.

Macro Definition Documentation

◆ JS8_ALLOW_EXTENDED

#define JS8_ALLOW_EXTENDED   1

Allow extended latin-1 capital charset

◆ JS8_AUTO_SYNC

#define JS8_AUTO_SYNC   1

Enable the experimental auto sync feature

◆ JS8_DECODE_THREAD

#define JS8_DECODE_THREAD   1

Use a separate thread for decode process handling

◆ JS8_NSMAX

#define JS8_NSMAX   6827

Maximum number of samples

◆ JS8_NSPS

#define JS8_NSPS   6192

Number of samples per second

◆ JS8_NTMAX

#define JS8_NTMAX   60

Maximum number of seconds in a frame

◆ JS8_NUM_SYMBOLS

#define JS8_NUM_SYMBOLS   79

Number of symbols in the JS8 alphabet

◆ JS8_RING_BUFFER

#define JS8_RING_BUFFER   1

Use a ring buffer instead of clearing the decode frames

◆ JS8_RX_SAMPLE_RATE

#define JS8_RX_SAMPLE_RATE   12000

Sample rate for RX (samples per second)

Function Documentation

◆ code_time()

int code_time ( int hour,
int minute,
int second )
inline

Encode hour, minute, and second into a single integer.

Parameters
hourHour component (0-23).
minuteMinute component (0-59).
secondSecond component (0-59).
Returns
Encoded integer representing the time as HHMMSS.

This function combines the hour, minute, and second into a single integer for compact representation. The format is HHMMSS, where HH is the hour, MM is the minute, and SS is the second.

◆ decode_time()

hour_minute_second decode_time ( int nutc)
inline

Decode an integer into hour, minute, and second components.

Parameters
nutcEncoded integer representing time as HHMMSS.
Returns
A struct containing the hour, minute, and second components.

This function reverses the encoding performed by code_time(), extracting the hour, minute, and second from the compact integer representation.

Here is the caller graph for this function: