<jupyter_start><jupyter_text>EPID - Embedded Proportional-Integral-Derivative (PID) controller Testing the C library **EPID v1** low-pass filter functions.--- Test parameters:- Filter type: 1st order IIR low-pass filter.- Sample period: 0.001 s- Samples count: 250- Signal frequency: 10 Hz- Signal noise frequency: 250 Hz- Filter cutoff frequency: 20 Hz- simulation time: ~ 0.25s---<jupyter_code>import os
import pandas as pd
import matplotlib.pyplot as plt
# For Jupyter notebook, include:
%matplotlib inline
os.system("gcc -std=c99 -O2 -Wall -Wextra -pedantic test_lpf.c -lm -o test_lpf.bin") # Compile the test source-code
os.system("./test_lpf.bin > test_lpf.csv 2>&1") # Execute and save the output as an CSV file.

df = pd.read_csv("test_lpf.csv", delimiter="\t") # Load the CSV output data
#df.describe() # Show various statistics<jupyter_output><empty_output><jupyter_text>---<!--- Delete first X-sec from timeto_delete = 0sample_period = 0.1from math import floor as floordf = df.iloc[floor(to_delete/sample_period):]--><jupyter_code># Plot:
# f(t)="System Sensor (C)", g(t)="Controller Output (W)", d(t)="PID Delta"

plt.style.use('seaborn-darkgrid')
ax = df.plot(x="Time (s)", kind='line', subplots=False, 
             linewidth=1.5, grid=True, figsize=(15, 5))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14428242517267845, 'fraction_numerical': 0.024558710667689946, 'mean_word_length': 4.8475336322869955, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '550045', 'license': '0BSD', 'n_tokens_mistral': 493, 'n_tokens_neox': 450, 'n_words': 132, 'path': 'extras/testing/plot_filter.ipynb', 'repo_name': 'abderraouf-adjal/Embedded-PID', 'size': '1303'}