Skip to content
Extraits de code Groupes Projets
Valider f0ed51ae rédigé par Félix Willaumez's avatar Félix Willaumez
Parcourir les fichiers

clean chaine telecom

parent b75c1389
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 8159 ajouts et 13814 suppressions
......@@ -8,8 +8,8 @@
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/felix/Documents/Ecole/Q7/projetQ7/mcu/hands_on_main_app/Core/Src",
"program": "c:/Users/felix/Documents/Ecole/Q7/projetQ7/mcu/hands_on_main_app/Core/Src/build/Debug/outDebug",
"cwd": "c:/Users/felix/Documents/Ecole/Q7/projetQ7/mcu/hands_on_feature_vectors/Core/Src",
"program": "c:/Users/felix/Documents/Ecole/Q7/projetQ7/mcu/hands_on_feature_vectors/Core/Src/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
......
......@@ -2,5 +2,61 @@
"C_Cpp_Runner.msvcBatchPath": "",
"files.associations": {
"arm_math.h": "c"
}
},
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import numpy as np
from typing import Optional
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import RobustScaler,Normalizer
import click
......@@ -76,37 +77,45 @@ def main(
if m:
# TODO: perform classification
SUBMIT = False
SUBMIT = True
classnames = ["birds","chainsaw","fire","handsaw","helicopter"]
data = StandardScaler().fit_transform(melvecs.flatten()[:,np.newaxis]).flatten().reshape(1,-1)
data = data/np.abs(np.max(data))
y_prediction = m.predict(data)
#melvec= melvecs/np.abs(np.max(melvecs))
#melvec = StandardScaler().fit_transform(melvec.reshape(-1,1)).reshape(-1)
#melvec = RobustScaler().fit_transform(melvec.reshape(-1,1)).reshape(-1)
#melvec = Normalizer().fit_transform(melvec.reshape(-1,1)).reshape(-1)
#y_prediction = m.predict(melvec)
print('Class predicted by the model:', y_prediction[0])
if SUBMIT :
url = "http://lelec210x.sipr.ucl.ac.be/"
key = "0gxp3uC4UBRCH_6v_y2LWDi_TJxk1vVT6AlHXufT"
response = requests.post(f"{url}/lelec210x/leaderboard/submit/{key}/{y_prediction[0]}",timeout=1)
response = requests.post(f"{url}/lelec210x/leaderboard/submit/{key}/{y_prediction[0]}",timeout=0.1)
print(response)
# All responses are JSON dictionaries
response_as_dict = json.loads(response.text)
logger.info(response_as_dict)
proba = m.predict_proba(data)
proba = m.predict_proba(melvecs)
plot = True
plot = False
if plot:
model_dir = Path(__file__).parent.parent.parent / "data_mcu" /"birds_107.npy"
training_data = np.load(model_dir)
training_data = StandardScaler().fit_transform(training_data[:,np.newaxis]).flatten().reshape(1,-1)
training_data = training_data/np.abs(np.max(training_data))
plt.subplot(1,2,1)
plt.bar(classnames, proba[0])
#plt.bar(classnames, proba[0])
plt.subplot(1,2,2)
plt.imshow((np.reshape(data - training_data, (-1,20))))
plt.colorbar()
......
......@@ -11,13 +11,13 @@
#define MAIN_APP 0
#define EVAL_RADIO 1
#define RUN_CONFIG MAIN_APP
#define RUN_CONFIG EVAL_RADIO
// Radio parameters
#define ENABLE_RADIO 1
// General UART enable/disable (disable for low-power operation)
#define ENABLE_UART 0
#define ENABLE_UART 1
// In continuous mode, we start and stop continuous acquisition on button press.
// In non-continuous mode, we send a single packet on button press.
......@@ -29,14 +29,14 @@
#define N_MELVECS 20
#define N_MELVECS_DETECTION 20 // nombre de melvecs sur lequel on regarde si il y a un son ou non
#define DETECTION_FACTOR 10
#define NUMBER_OF_PACKETS_WHEN_DETECTED 3
#define DETECTION_FACTOR 5
#define NUMBER_OF_PACKETS_WHEN_DETECTED 2
// Enable performance measurements
#define PERF_COUNT 0
// Enable debug print
#define DEBUGP 0
#define DEBUGP 1
#if (DEBUGP == 1)
#define DEBUG_PRINT(...) do{ printf(__VA_ARGS__ ); } while( 0 )
......
......@@ -6,10 +6,10 @@
#define INC_EVAL_RADIO_H_
// Radio evaluation parameters
#define MIN_PA_LEVEL 5// initial Tx transmit power, in dBm
#define MIN_PA_LEVEL -8// initial Tx transmit power, in dBm
#define MAX_PA_LEVEL 45 // final Tx transmit power, in dBm
#define N_PACKETS 5 // number of packets transmitted for each Tx power level
#define PAYLOAD_LEN 100 // payload length of the transmitted packets
#define N_PACKETS 400// number of packets transmitted for each Tx power level
#define PAYLOAD_LEN 400 // payload length of the transmitted packets
#define PACKET_DELAY 1 // delay between two packets, in seconds
void eval_radio(void);
......
......@@ -36,9 +36,9 @@ void eval_radio(void)
for(uint16_t j=0; j < PACKET_DELAY; j++) {
HAL_GPIO_WritePin(GPIOB, LD2_Pin, GPIO_PIN_SET);
HAL_Delay(500);
HAL_Delay(10);
HAL_GPIO_WritePin(GPIOB, LD2_Pin, GPIO_PIN_RESET);
HAL_Delay(500);
HAL_Delay(10);
}
}
}
......
Aucun aperçu pour ce type de fichier
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
---------------------------------------------------------------
LimeSuite Source (RX) info
##################
Connecting to device
##################
LimeSuite version: 22.09.1-myriadrf1~ubuntu20.04
gr-limesdr version: v1.0-compat-xxx-xunknown
##################
Device list:
Nr.:0 device:LimeSDR Mini, media=USB 3.0, module=FT601, addr=24607:1027, serial=1D7505D7DD37D1
##################
INFO: device_handler::open_device(): no serial number. Using first device in the list.
Use "LimeUtil --find" in terminal to find prefered device serial.
Using device: LimeSDR-Mini(1D7505D7DD37D1) GW: 1.29 FW: 6
##################
INFO: device_handler::enable_channels(): SISO CH0 set for device number 0.
INFO: device_handler::set_samp_rate(): set sampling rate: 0.4 MS/s.
INFO: device_handler::set_rf_freq(): RF frequency set [RX]: 868 MHz.
INFO: device_handler::set_analog_filter(): INFO: device_handler::set_digital_filter(): digital filter CH0 [RX]: 0.4 MHz.
INFO: device_handler::set_gain():
Clearing running sum before changing gain
Actual : Short = 0 / Long = 0
Clear : Short = 0 / Long = 0
Set gain [RX] CH0: 70 dB.
Running : Short = 0 / Long = 0
INFO: device_handler::set_antenna(): CH0 antenna set [RX]: LNAW.
INFO: device_handler::calibrate(): INFO: device_handler::set_dspcfg_preamble(): INFO: source_impl::init_stream(): source channel 0 (device nr. 0) stream setup done.
Press Enter to quit: [SYNC] New preamble detected @ 5 (CFO 6.71 Hz, STO 5)
[SYNC] Estimated SNR: 37.64 dB (2048 samples)
[SYNC] New preamble detected @ 7053 (CFO 8.38 Hz, STO 5)
[SYNC] Estimated SNR: 37.70 dB (3199 samples)
[SYNC] New preamble detected @ 14098 (CFO -0.62 Hz, STO 2)
[SYNC] Estimated SNR: 37.66 dB (4096 samples)
[MAC] Error in CRC, packet dropped [ 10 104 208 206 31 72 252 213 28 50 47 237 173 238 116 182 114 179
39 19 0 0 0 0 0 0 3 132 4 10 161 65 88 212 161 194
66 48 107 149 37 192 159 242 154 67 203 111 101 252 80 37 73 187
78 147 201 217 245 166 228 104 158 209 108 178 74 220 111 129 144 124
34 4 91 140 162 172 87 48 136 81 112 207 83 119 152 109 131 206
79 8 66 116 53 172 183 141 234 64] [166]
--- 1 packets received with 1 error(s) ---
[MAC] Error in CRC, packet dropped [143 90 186 141 98 173 170 181 53 98 2 49 132 35 134 218 157 74
225 249 232 50 84 216 81 211 160 19 88 4 33 106 83 9 49 20
38 236 210 30 104 209 143 100 217 104 172 74 113 108 88 128 150 145
236 82 194 52 66 117 52 190 180 132 154 155 60 196 3 70 195 242
131 3 170 46 10 232 168 133 13 150 4 1 8 182 13 34 236 100
98 202 96 12 212 215 93 68 88 160] [15]
--- 2 packets received with 2 error(s) ---
[SYNC] New preamble detected @ 21147 (CFO -13.62 Hz, STO 3)
[SYNC] Estimated SNR: 37.68 dB (4096 samples)
[MAC] Error in CRC, packet dropped [226 195 84 93 13 71 201 94 25 215 35 14 161 148 171 84 124 9
103 62 103 81 133 220 157 54 249 16 32 101 46 165 12 93 105 96
17 54 83 196 70 231 82 133 253 253 136 139 181 224 222 111 114 112
207 137 196 45 234 134 28 100 201 199 95 113 60 81 236 202 94 186
61 121 132 99 224 102 130 152 32 186 193 85 78 211 255 21 203 4
165 71 31 155 103 110 146 45 220 136] [65]
--- 3 packets received with 3 error(s) ---
[SYNC] New preamble detected @ 28193 (CFO -11.38 Hz, STO 1)
[SYNC] Estimated SNR: 37.71 dB (4096 samples)
[MAC] Error in CRC, packet dropped [ 63 120 23 170 33 131 183 215 9 240 173 249 149 159 101 252 1 170
155 195 199 170 204 59 37 179 215 150 153 33 249 129 91 60 44 143
57 255 173 221 215 237 184 91 183 19 7 18 150 113 200 25 142 221
60 26 175 174 47 46 220 233 220 151 253 91 113 147 100 253 209 80
254 186 62 65 51 226 92 249 21 243 216 72 245 250 197 85 212 181
191 163 89 201 23 218 109 239 186 199] [99]
--- 4 packets received with 4 error(s) ---
[MAC] Error in CRC, packet dropped [ 94 173 106 106 186 228 108 216 249 185 105 99 238 178 173 207 94 187
208 241 93 8 103 160 55 29 23 195 167 213 99 7 44 214 137 115
232 153 178 148 188 180 175 200 17 74 66 142 184 99 187 128 23 220
243 157 12 146 218 230 22 228 32 126 64 250 206 42 79 149 62 119
245 168 213 99 150 113 151 240 154 121 178 244 41 11 42 207 166 39
41 124 118 123 185 47 92 112 227 175] [149]
--- 5 packets received with 5 error(s) ---
##################
INFO: device_handler::close_device(): Disconnected from device number 0.
##################
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter