diff options
-rw-r--r-- | controller/fw/Makefile | 10 | ||||
-rw-r--r-- | controller/fw/levmarq/levmarq.c | 12 | ||||
-rw-r--r-- | controller/fw/src/adc.c | 12 | ||||
-rw-r--r-- | controller/fw/src/freq_meas.c | 27 | ||||
-rw-r--r-- | controller/fw/src/main.c | 75 | ||||
-rw-r--r-- | controller/fw/src/system_stm32f4xx.c | 5 | ||||
-rw-r--r-- | controller/fw/tools/dsss_demod_test.c | 2 | ||||
-rw-r--r-- | controller/fw/tools/e2e_test.c | 111 | ||||
-rw-r--r-- | controller/fw/tools/freq_meas_test.c | 6 | ||||
-rw-r--r-- | controller/fw/tools/presig_gen.py | 16 | ||||
-rw-r--r-- | lab-windows/dsss_experiments-ber.ipynb | 2 | ||||
-rw-r--r-- | lab-windows/scratch.ipynb | 61 |
12 files changed, 286 insertions, 53 deletions
diff --git a/controller/fw/Makefile b/controller/fw/Makefile index 89960d2..0fea8ae 100644 --- a/controller/fw/Makefile +++ b/controller/fw/Makefile @@ -60,6 +60,7 @@ MUSL_SOURCES += $(MUSL_DIR)/src/math/tanhf.c $(MUSL_DIR)/src/math/atanhf.c MUSL_SOURCES += $(MUSL_DIR)/src/math/expm1f.c $(MUSL_DIR)/src/math/log1pf.c MUSL_SOURCES += $(MUSL_DIR)/src/math/expf.c $(MUSL_DIR)/src/math/exp2f_data.c MUSL_SOURCES += $(MUSL_DIR)/src/math/powf.c +MUSL_SOURCES += $(MUSL_DIR)/src/math/sqrtf.c MUSL_SOURCES += $(MUSL_DIR)/src/math/fabsf.c MUSL_SOURCES += $(MUSL_DIR)/src/stdlib/abs.c MUSL_SOURCES += $(MUSL_DIR)/src/string/memset.c @@ -84,6 +85,8 @@ LDSCRIPT := stm32f407.ld PREFIX ?= arm-none-eabi- +DEBUG ?= 1 + CC := $(PREFIX)gcc CXX := $(PREFIX)g++ LD := $(PREFIX)gcc @@ -121,7 +124,7 @@ CFLAGS += -I$(abspath musl_include_shims) COMMON_CFLAGS += -I$(BUILDDIR) -Isrc -Itinyaes CFLAGS += -I$(CUBE_DIR)/Drivers/CMSIS/Device/ST/STM32F4xx/Include -COMMON_CFLAGS += -O0 -std=gnu11 -g -DSTM32F407xx -DSTM32F4 +COMMON_CFLAGS += -O0 -std=gnu11 -g -DSTM32F407xx -DSTM32F4 -DDEBUG=$(DEBUG) CFLAGS += $(ARCH_FLAGS) $(SYSTEM_FLAGS) #SIM_CFLAGS += -mthumb -mcpu=cortex-m4 -mfloat-abi=soft CFLAGS += -fno-common -ffunction-sections -fdata-sections @@ -248,6 +251,11 @@ $(BUILDDIR)/tools/crypto_test: tools/crypto_test.c src/crypto.c tinyaes/aes.c $( mkdir -p $(@D) $(HOST_CC) $(COMMON_CFLAGS) $(SIM_CFLAGS) -lsodium -o $@ $^ +tools: $(BUILDDIR)/tools/e2e_test +$(BUILDDIR)/tools/e2e_test: tools/e2e_test.c src/freq_meas.c levmarq/levmarq.c $(BUILDDIR)/generated/fmeas_fft_window.c $(CMSIS_SOURCES) src/dsss_demod.c $(BUILDDIR)/generated/dsss_cwt_wavelet.c $(BUILDDIR)/generated/gold_code_$(DSSS_GOLD_CODE_NBITS).c + mkdir -p $(@D) + $(HOST_CC) $(COMMON_CFLAGS) $(SIM_CFLAGS) -o $@ $^ + $(BUILDDIR)/src/%.o: src/%.s mkdir -p $(@D) $(CC) $(COMMON_CFLAGS) $(CFLAGS) $(INT_CFLAGS) -o $@ -c $< diff --git a/controller/fw/levmarq/levmarq.c b/controller/fw/levmarq/levmarq.c index 4636c79..4a764db 100644 --- a/controller/fw/levmarq/levmarq.c +++ b/controller/fw/levmarq/levmarq.c @@ -17,8 +17,6 @@ #include <stdio.h> #include <math.h> -#include <arm_math.h> - #include "levmarq.h" #include "simulation.h" @@ -29,21 +27,13 @@ /* set parameters required by levmarq() to default values */ void levmarq_init(LMstat *lmstat) { - lmstat->max_it = 500; + lmstat->max_it = 100; lmstat->init_lambda = 0.0001f; lmstat->up_factor = 10.0f; lmstat->down_factor = 10.0f; lmstat->target_derr = 1e-12f; } -#ifndef SIMULATION -float sqrtf(float arg) { - float out=NAN; - arm_sqrt_f32(arg, &out); - return out; -} -#endif - /* perform least-squares minimization using the Levenberg-Marquardt algorithm. The arguments are as follows: diff --git a/controller/fw/src/adc.c b/controller/fw/src/adc.c index 07431be..74f0aa9 100644 --- a/controller/fw/src/adc.c +++ b/controller/fw/src/adc.c @@ -51,8 +51,9 @@ void adc_init() { ADC1->CR1 = (0<<ADC_CR1_RES_Pos) | (0<<ADC_CR1_DISCNUM_Pos) | ADC_CR1_DISCEN | (0<<ADC_CR1_AWDCH_Pos); ADC1->CR2 = (1<<ADC_CR2_EXTEN_Pos) | (0<<ADC_CR2_EXTSEL_Pos) | ADC_CR2_DMA | ADC_CR2_ADON | ADC_CR2_DDS; - ADC1->SQR3 = (adc_channel<<ADC_SQR3_SQ3_Pos); + ADC1->SQR3 = (adc_channel<<ADC_SQR3_SQ1_Pos); ADC1->SQR1 = (0<<ADC_SQR1_L_Pos); + ADC1->SMPR2 = (7<<ADC_SMPR2_SMP0_Pos); TIM1->CR2 = (2<<TIM_CR2_MMS_Pos); /* Enable update event on TRGO to provide a 1ms reference to rest of system */ TIM1->CCMR1 = (6<<TIM_CCMR1_OC1M_Pos) | (0<<TIM_CCMR1_CC1S_Pos); @@ -86,11 +87,17 @@ void DMA2_Stream0_IRQHandler(void) { uint8_t isr = (DMA2->LISR >> DMA_LISR_FEIF0_Pos) & 0x3f; GPIOA->ODR ^= 1<<7; + GPIOA->BSRR = 1<<10; if (isr & DMA_LISR_TCIF0) { /* Transfer complete */ /* Check we're done processing the old buffer */ - if (adc_fft_buf_ready_idx != -1) + if (adc_fft_buf_ready_idx != -1) { /* FIXME DEBUG */ + GPIOA->BSRR = 1<<10<<16; + /* clear all flags */ + adc_dma->LIFCR = isr<<DMA_LISR_FEIF0_Pos; + return; panic(); + } /* Kickoff FFT */ int ct = !!(adc_stream->CR & DMA_SxCR_CT); @@ -103,6 +110,7 @@ void DMA2_Stream0_IRQHandler(void) { if (isr & DMA_LISR_TEIF0) /* Transfer error */ panic(); + GPIOA->BSRR = 1<<10<<16; /* clear all flags */ adc_dma->LIFCR = isr<<DMA_LISR_FEIF0_Pos; } diff --git a/controller/fw/src/freq_meas.c b/controller/fw/src/freq_meas.c index 83a330c..020e12d 100644 --- a/controller/fw/src/freq_meas.c +++ b/controller/fw/src/freq_meas.c @@ -1,4 +1,8 @@ +#ifndef SIMULATION +#include <stm32f407xx.h> +#endif + #include <unistd.h> #include <math.h> @@ -57,7 +61,13 @@ int adc_buf_measure_freq(uint16_t adc_buf[FMEAS_FFT_LEN], float *out) { DEBUG_PRINTN("%010f, ", in_buf[i]); DEBUG_PRINTN("\n"); */ +#ifndef SIMULATION + GPIOA->BSRR = 1<<12; +#endif arm_rfft_fast_f32(&fft_inst, in_buf, out_buf, 0); +#ifndef SIMULATION + GPIOA->BSRR = 1<<12<<16; +#endif #define FMEAS_FFT_WINDOW_MIN_F_HZ 30.0f #define FMEAS_FFT_WINDOW_MAX_F_HZ 70.0f @@ -66,6 +76,7 @@ int adc_buf_measure_freq(uint16_t adc_buf[FMEAS_FFT_LEN], float *out) { const size_t last_bin = (int)(FMEAS_FFT_WINDOW_MAX_F_HZ / binsize_hz + 0.5f); const size_t nbins = last_bin - first_bin + 1; + /* DEBUG_PRINT("binsize_hz=%f first_bin=%zd last_bin=%zd nbins=%zd", binsize_hz, first_bin, last_bin, nbins); DEBUG_PRINTN(" [bins real] "); for (size_t i=0; i<FMEAS_FFT_LEN/2; i+=2) @@ -76,6 +87,7 @@ int adc_buf_measure_freq(uint16_t adc_buf[FMEAS_FFT_LEN], float *out) { DEBUG_PRINT("\n"); DEBUG_PRINT("Repacking FFT results"); + */ /* Copy real values of target data to front of output buffer */ for (size_t i=0; i<nbins; i++) { float real = out_buf[2 * (first_bin + i)]; @@ -83,7 +95,9 @@ int adc_buf_measure_freq(uint16_t adc_buf[FMEAS_FFT_LEN], float *out) { out_buf[i] = sqrtf(real*real + imag*imag); } + /* DEBUG_PRINT("Running Levenberg-Marquardt"); + */ LMstat lmstat; levmarq_init(&lmstat); @@ -99,16 +113,29 @@ int adc_buf_measure_freq(uint16_t adc_buf[FMEAS_FFT_LEN], float *out) { float par[3] = { a_max, i_max, 1.0f }; + /* DEBUG_PRINT(" par_pre={%010f, %010f, %010f}", par[0], par[1], par[2]); + */ +#ifndef SIMULATION + GPIOA->BSRR = 1<<12; +#endif if (levmarq(3, par, nbins, out_buf, NULL, func_gauss, func_gauss_grad, NULL, &lmstat) < 0) { +#ifndef SIMULATION + GPIOA->BSRR = 1<<12<<16; +#endif *out = NAN; return -1; } +#ifndef SIMULATION + GPIOA->BSRR = 1<<12<<16; +#endif + /* DEBUG_PRINT(" par_post={%010f, %010f, %010f}", par[0], par[1], par[2]); DEBUG_PRINT("done."); + */ *out = (par[1] + first_bin) * binsize_hz; return 0; } diff --git a/controller/fw/src/main.c b/controller/fw/src/main.c index c03bcbb..fa5d50b 100644 --- a/controller/fw/src/main.c +++ b/controller/fw/src/main.c @@ -3,6 +3,7 @@ #include <stdint.h> #include <assert.h> #include <string.h> +#include <math.h> #include <stm32f407xx.h> @@ -159,50 +160,52 @@ void spi_flash_test(void) { static unsigned int measurement_errors = 0; static struct dsss_demod_state demod_state; static uint32_t freq_sample_ts = 0; -static uint32_t debug_last_freq = 0; +static float debug_last_freq = 0; int main(void) { - /* DEBUG */ - /* MCO2 */ +#if DEBUG + /* PLL clock on MCO2 (pin C9) */ RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN; GPIOC->MODER &= ~GPIO_MODER_MODER9_Msk; GPIOC->MODER |= (2<<GPIO_MODER_MODER9_Pos); GPIOC->AFR[1] &= ~GPIO_AFRH_AFSEL9_Msk; GPIOC->OSPEEDR |= (3<<GPIO_OSPEEDR_OSPEED9_Pos); /* SCK */ RCC->CFGR |= (6<<RCC_CFGR_MCO2PRE_Pos) | (3<<RCC_CFGR_MCO2_Pos); - /* END DEBUG */ +#endif + + if (((SCB->CPACR>>20) & 0xf) != 0xf) { + asm volatile ("bkpt"); + } clock_setup(); led_setup(); - /* spi_flash_setup(); adc_init(); - */ - /* DEBUG */ - /* TIM1 CC1 */ +#if DEBUG + /* TIM1 CC1 (ADC trigger) on pin A8 */ GPIOA->MODER &= ~GPIO_MODER_MODER8_Msk; GPIOA->MODER |= (2<<GPIO_MODER_MODER8_Pos); GPIOA->AFR[1] &= ~GPIO_AFRH_AFSEL8_Msk; GPIOA->AFR[1] |= 1<<GPIO_AFRH_AFSEL8_Pos; - /* END DEBUG */ - int cnt = 0; - while (23) { - if (cnt++ == 100000) { - cnt = 0; - GPIOA->ODR ^= 1<<6; - } + GPIOA->MODER |= (1<<GPIO_MODER_MODER9_Pos) | (1<<GPIO_MODER_MODER10_Pos) | (1<<GPIO_MODER_MODER11_Pos) | + (1<<GPIO_MODER_MODER12_Pos) | (1<<GPIO_MODER_MODER15_Pos); +#endif + while (23) { if (adc_fft_buf_ready_idx != -1) { + GPIOA->BSRR = 1<<9; + adc_fft_buf_ready_idx = !adc_fft_buf_ready_idx; /* DEBUG */ memcpy(adc_fft_buf[!adc_fft_buf_ready_idx], adc_fft_buf[adc_fft_buf_ready_idx] + FMEAS_FFT_LEN/2, sizeof(adc_fft_buf[0][0]) * FMEAS_FFT_LEN/2); + GPIOA->BSRR = 1<<9<<16; + GPIOA->BSRR = 1<<11; -#if 0 float out; if (adc_buf_measure_freq(adc_fft_buf[adc_fft_buf_ready_idx], &out)) { measurement_errors++; - debug_last_freq = -1; + debug_last_freq = NAN; } else { debug_last_freq = out; @@ -212,7 +215,7 @@ int main(void) dsss_demod_step(&demod_state, out, freq_sample_ts); */ } -#endif + GPIOA->BSRR = 1<<11<<16; freq_sample_ts++; /* TODO: also increase in case of freq measurement error? */ adc_fft_buf_ready_idx = -1; @@ -222,3 +225,39 @@ int main(void) return 0; } +void NMI_Handler(void) { + asm volatile ("bkpt"); +} + +void HardFault_Handler(void) { + asm volatile ("bkpt"); +} + +void MemManage_Handler(void) { + asm volatile ("bkpt"); +} + +void BusFault_Handler(void) { + asm volatile ("bkpt"); +} + +void UsageFault_Handler(void) { + asm volatile ("bkpt"); +} + +void SVC_Handler(void) { + asm volatile ("bkpt"); +} + +void DebugMon_Handler(void) { + asm volatile ("bkpt"); +} + +void PendSV_Handler(void) { + asm volatile ("bkpt"); +} + +void SysTick_Handler(void) { + asm volatile ("bkpt"); +} + diff --git a/controller/fw/src/system_stm32f4xx.c b/controller/fw/src/system_stm32f4xx.c index 9037604..5d005ed 100644 --- a/controller/fw/src/system_stm32f4xx.c +++ b/controller/fw/src/system_stm32f4xx.c @@ -165,10 +165,9 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; */ void SystemInit(void) { - /* FPU settings ------------------------------------------------------------*/ - #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ - #endif + __DSB(); + __ISB(); #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) SystemInit_ExtMemCtl(); diff --git a/controller/fw/tools/dsss_demod_test.c b/controller/fw/tools/dsss_demod_test.c index 64fd889..7a4ca71 100644 --- a/controller/fw/tools/dsss_demod_test.c +++ b/controller/fw/tools/dsss_demod_test.c @@ -70,7 +70,7 @@ int main(int argc, char **argv) { fprintf(stderr, "Reading %zd samples test data...", st.st_size/sizeof(float)); ssize_t nread = 0; while (nread < st.st_size) { - ssize_t rc = read(fd, buf, st.st_size - nread); + ssize_t rc = read(fd, buf + nread, st.st_size - nread); if (rc == -EINTR || rc == -EAGAIN) continue; diff --git a/controller/fw/tools/e2e_test.c b/controller/fw/tools/e2e_test.c new file mode 100644 index 0000000..935f70d --- /dev/null +++ b/controller/fw/tools/e2e_test.c @@ -0,0 +1,111 @@ + +#include <stdint.h> +#include <math.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <sys/fcntl.h> + +#include "freq_meas.h" +#include "dsss_demod.h" + +typedef uint16_t adc_data_t; + +void handle_dsss_received(uint8_t data[static TRANSMISSION_SYMBOLS]) { + printf("data sequence received: [ "); + for (size_t i=0; i<TRANSMISSION_SYMBOLS; i++) { + printf("%+3d", ((data[i]&1) ? 1 : -1) * (data[i]>>1)); + if (i+1 < TRANSMISSION_SYMBOLS) + printf(", "); + } + printf(" ]\n"); +} + +void print_usage(void); +void print_usage() { + fprintf(stderr, "Usage: e2e_test [emulated_adc_data.bin]\n"); +} + +int main(int argc, char **argv) { + if (argc != 2) { + fprintf(stderr, "Error: Invalid arguments.\n"); + print_usage(); + return 1; + } + + int fd = open(argv[1], O_RDONLY); + struct stat st; + if (fstat(fd, &st)) { + fprintf(stderr, "Error querying test data file size: %s\n", strerror(errno)); + return 2; + } + + if (st.st_size < 0 || st.st_size > 100000000) { + fprintf(stderr, "Error reading test data: too much test data (size=%zd)\n", st.st_size); + return 2; + } + + if (st.st_size % sizeof(adc_data_t) != 0) { + fprintf(stderr, "Error reading test data: file size is not divisible by %zd (size=%zd)\n", sizeof(adc_data_t), st.st_size); + return 2; + } + + char *buf = malloc(st.st_size); + if (!buf) { + fprintf(stderr, "Error allocating memory"); + return 2; + } + + const size_t n_samples = st.st_size / sizeof(adc_data_t); + fprintf(stderr, "Reading %zd samples test data...", n_samples); + ssize_t nread = 0; + while (nread < st.st_size) { + ssize_t rc = read(fd, buf + nread, st.st_size - nread); + + if (rc == -EINTR || rc == -EAGAIN) + continue; + + if (rc < 0) { + fprintf(stderr, "\nError reading test data: %s\n", strerror(errno)); + return 2; + } + + if (rc == 0) { + fprintf(stderr, "\nError reading test data: Unexpected end of file\n"); + return 2; + } + + nread += rc; + } + fprintf(stderr, " done. Read %zd bytes.\n", nread); + + adc_data_t *buf_d = (adc_data_t *)buf; + + struct dsss_demod_state demod; + dsss_demod_init(&demod); + + fprintf(stderr, "Starting simulation.\n"); + size_t iterations = (n_samples-FMEAS_FFT_LEN)/(FMEAS_FFT_LEN/2); + for (size_t i=0; i<iterations; i++) { + + /* + fprintf(stderr, "Iteration %zd/%zd\n", i, iterations); + */ + float res = NAN; + int rc = adc_buf_measure_freq(buf_d + i*(FMEAS_FFT_LEN/2), &res); + if (rc) + printf("ERROR: Simulation error in iteration %zd at position %zd: %d\n", i, i*(FMEAS_FFT_LEN/2), rc); + + dsss_demod_step(&demod, res, i); + /* + printf("%09zd %12f\n", i, res); + */ + } + + free(buf); + return 0; +} diff --git a/controller/fw/tools/freq_meas_test.c b/controller/fw/tools/freq_meas_test.c index e80290e..e2900ad 100644 --- a/controller/fw/tools/freq_meas_test.c +++ b/controller/fw/tools/freq_meas_test.c @@ -49,9 +49,9 @@ int main(int argc, char **argv) { } fprintf(stderr, "Reading %zd samples test data...", st.st_size/sizeof(float)); - size_t nread = 0; + ssize_t nread = 0; while (nread < st.st_size) { - ssize_t rc = read(fd, buf, st.st_size - nread); + ssize_t rc = read(fd, buf + nread, st.st_size - nread); if (rc == -EINTR || rc == -EAGAIN) continue; @@ -100,5 +100,7 @@ int main(int argc, char **argv) { printf("%09zd %12f\n", i, res); } + free(buf); + free(sim_adc_buf); return 0; } diff --git a/controller/fw/tools/presig_gen.py b/controller/fw/tools/presig_gen.py index ff9dffe..3f85522 100644 --- a/controller/fw/tools/presig_gen.py +++ b/controller/fw/tools/presig_gen.py @@ -123,17 +123,17 @@ if __name__ == '__main__': auth_parser.add_argument('height', type=int, help='Authentication string height, counting from 0 (root key)') auth_parser.set_defaults(func=auth_cmd) auth_parser.add_argument('-a', '--all', action='store_const', const='all', help='Vendor name for vendor domain') - auth_parser.add_argument('-v', '--vendor', type=str, nargs='?', const=test_vendor, help='Vendor name for vendor domain') - auth_parser.add_argument('-s', '--series', type=str, nargs='?', const=test_series, help='Series identifier for series domain') - auth_parser.add_argument('-r', '--region', type=str, nargs='?', const=test_region, help='Region name for region domain') - auth_parser.add_argument('-c', '--country', type=str, nargs='?', const=test_country, help='Country name for country domain') + auth_parser.add_argument('-v', '--vendor', type=str, nargs='?', const=TEST_VENDOR, help='Vendor name for vendor domain') + auth_parser.add_argument('-s', '--series', type=str, nargs='?', const=TEST_SERIES, help='Series identifier for series domain') + auth_parser.add_argument('-r', '--region', type=str, nargs='?', const=TEST_REGION, help='Region name for region domain') + auth_parser.add_argument('-c', '--country', type=str, nargs='?', const=TEST_COUNTRY, help='Country name for country domain') prekey_parser = subparsers.add_parser('prekey', help='Generate prekey data .C source code file') prekey_parser.add_argument('-m', '--max-height', type=int, default=8, help='Height of generated prekey') - prekey_parser.add_argument('-v', '--vendor', type=str, default=test_vendor, help='Vendor name for vendor domain') - prekey_parser.add_argument('-s', '--series', type=str, default=test_series, help='Series identifier for series domain') - prekey_parser.add_argument('-r', '--region', type=str, default=test_region, help='Region name for region domain') - prekey_parser.add_argument('-c', '--country', type=str, default=test_country, help='Country name for country domain') + prekey_parser.add_argument('-v', '--vendor', type=str, default=TEST_VENDOR, help='Vendor name for vendor domain') + prekey_parser.add_argument('-s', '--series', type=str, default=TEST_SERIES, help='Series identifier for series domain') + prekey_parser.add_argument('-r', '--region', type=str, default=TEST_REGION, help='Region name for region domain') + prekey_parser.add_argument('-c', '--country', type=str, default=TEST_COUNTRY, help='Country name for country domain') prekey_parser.set_defaults(func=prekey_cmd, all='all') args = parser.parse_args() diff --git a/lab-windows/dsss_experiments-ber.ipynb b/lab-windows/dsss_experiments-ber.ipynb index fd2466b..870ed64 100644 --- a/lab-windows/dsss_experiments-ber.ipynb +++ b/lab-windows/dsss_experiments-ber.ipynb @@ -1283,7 +1283,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.8.2" } }, "nbformat": 4, diff --git a/lab-windows/scratch.ipynb b/lab-windows/scratch.ipynb index ddd2455..93a11fe 100644 --- a/lab-windows/scratch.ipynb +++ b/lab-windows/scratch.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 7, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -27,13 +27,62 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 25, "metadata": {}, "outputs": [ { + "name": "stderr", + "output_type": "stream", + "text": [ + "<ipython-input-25-f95a3be8874f>:1: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).\n", + " fig, ax = plt.subplots()\n" + ] + }, + { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "712481c28d9d4e1d874a66d31c3e8bff", + "model_id": "62a620e3551e46c38fb0d0e017b8e357", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "[<matplotlib.lines.Line2D at 0x7f731d79f2b0>]" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "fig, ax = plt.subplots()\n", + "ax.plot([797, 813, 869, 971, 1128, 1298, 1461, 1609, 1750, 1826, 1881, 1860, 1789, 1695, 1552, 1360, 1209, 1048, 921, 832, 803, 812, 870, 972, 1125, 1284, 1461, 1618, 1757, 1834, 1835, 1861, 1795, 1685, 1545, 1383, 1217, 1046, 908, 832,\n", + " 800, 815, 864, 993, 1084, 1296, 1453, 1613, 1746, 1833, 1875, 1859, 1794, 1693, 1542, 1352, 1211, 1049, 916, 833, 800, 810, 875, 992, 1144, 1300, 1447, 1606, 1735, 1836, 1846, 1869, 1811, 1701, 1557, 1375, 1208, 1060, 936, 836, 805,\n", + " 796, 877, 986, 1134, 1288, 1458, 1613, 1737, 1847, 1865, 1867, 1792, 1688, 1556, 1373, 1209, 1049, 928, 827, 792, 821, 869, 972, 1122, 1295, 1457, 1595, 1745, 1847, 1877, 1867, 1789, 1683, 1539, 1378, 1210, 1047, 917, 833, 817, 821,\n", + " 869, 977, 1128, 1299, 1458, 1630, 1711, 1833, 1833, 1869, 1800, 1715, 1545, 1375, 1217, 1060, 917, 841, 812, 826, 878, 985, 1128, 1280, 1452, 1612, 1739, 1827, 1892, 1864, 1793, 1700, 1547, 1375, 1212, 1054, 921, 829, 795, 809, 869,\n", + " 990, 1077, 1284, 1459, 1616, 1753, 1864, 1874, 1865, 1807, 1696, 1543, 1390, 1274, 1047, 926, 831, 804, 806, 872, 987, 1100, 1278, 1447, 1604, 1743, 1831, 1879, 1849, 1780, 1660, 1540, 1389, 1176, 1064, 928, 828, 812, 809, 875, 983,\n", + " 1128, 1285, 1456, 1611, 1739, 1889, 1879, 1879, 1793, 1680, 1546, 1381, 1215, 1074, 926, 842, 794, 857, 859, 978, 1123, 1290, 1427, 1607, 1737, 1835, 1882, 1861, 1815, 1694, 1532, 1375, 1202, 1050, 928, 822, 802, 810, 854, 990, 1119,\n", + " 1292, 1455, 1619, 1738, 1827, 1871, 1847, 1800, 1693, 1551, 1379])" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "fb0ad935348d4b3dab1c3548b9cfd628", "version_major": 2, "version_minor": 0 }, @@ -50,7 +99,7 @@ "(0, 64)" ] }, - "execution_count": 4, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -281,7 +330,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.8.2" } }, "nbformat": 4, |