@@ -47,7 +47,6 @@ JTEncode::JTEncode(void)
4747 * Ensure that you pass a uint8_t array of size JT65_SYMBOL_COUNT to the method.
4848 *
4949 */
50-
5150void JTEncode::jt65_encode (char * message, uint8_t * symbols)
5251{
5352 // Ensure that the message text conforms to standards
@@ -88,7 +87,6 @@ void JTEncode::jt65_encode(char * message, uint8_t * symbols)
8887 * Ensure that you pass a uint8_t array of size JT9_SYMBOL_COUNT to the method.
8988 *
9089 */
91-
9290void JTEncode::jt9_encode (char * message, uint8_t * symbols)
9391{
9492 // Ensure that the message text conforms to standards
@@ -123,6 +121,44 @@ void JTEncode::jt9_encode(char * message, uint8_t * symbols)
123121 jt9_merge_sync_vector (a, symbols);
124122}
125123
124+ /*
125+ * jt9_encode(char * message, uint8_t * symbols)
126+ *
127+ * Takes an arbitrary message of up to 13 allowable characters and returns
128+ * a channel symbol table.
129+ *
130+ * message - Plaintext Type 6 message.
131+ * symbols - Array of channel symbols to transmit retunred by the method.
132+ * Ensure that you pass a uint8_t array of size JT9_SYMBOL_COUNT to the method.
133+ *
134+ */
135+ void JTEncode::jt4_encode (char * message, uint8_t * symbols)
136+ {
137+ // Ensure that the message text conforms to standards
138+ // --------------------------------------------------
139+ jt_message_prep (message);
140+
141+ // Bit packing
142+ // -----------
143+ uint8_t c[13 ];
144+ jt9_bit_packing (message, c);
145+
146+ // Convolutional Encoding
147+ // ---------------------
148+ uint8_t s[JT4_SYMBOL_COUNT];
149+ convolve (c, s, 13 , JT4_BIT_COUNT);
150+
151+ // Interleaving
152+ // ------------
153+ jt9_interleave (s);
154+ memmove (s + 1 , s, JT4_BIT_COUNT);
155+ s[0 ] = 0 ; // Append a 0 bit to start of sequence
156+
157+ // Merge with sync vector
158+ // ----------------------
159+ jt4_merge_sync_vector (s, symbols);
160+ }
161+
126162/*
127163 * wspr_encode(char * call, char * loc, uint8_t dbm, uint8_t * symbols)
128164 *
@@ -135,7 +171,6 @@ void JTEncode::jt9_encode(char * message, uint8_t * symbols)
135171 * Ensure that you pass a uint8_t array of size WSPR_SYMBOL_COUNT to the method.
136172 *
137173 */
138-
139174void JTEncode::wspr_encode (char * call, char * loc, uint8_t dbm, uint8_t * symbols)
140175{
141176 // Ensure that the message text conforms to standards
@@ -655,6 +690,27 @@ void JTEncode::jt9_merge_sync_vector(uint8_t * g, uint8_t * symbols)
655690 }
656691}
657692
693+ void JTEncode::jt4_merge_sync_vector (uint8_t * g, uint8_t * symbols)
694+ {
695+ uint8_t i;
696+ const uint8_t sync_vector[JT4_SYMBOL_COUNT] =
697+ {0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 ,
698+ 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,1 ,1 ,
699+ 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 ,
700+ 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 ,
701+ 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 ,
702+ 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 ,
703+ 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 ,
704+ 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 ,
705+ 1 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