From the series files: the same indexes and notes the books are made from.
The example programs
Every program of the books is a project of its own, in a folder named after the chapter: I.1/PrimoSegnale, I.10/Analizzatore, I.19/Decimazione. It compiles and runs on its own, without the others. Names and comments are in Italian, like the books.
What you need
- the .NET 10 SDK (from dot.net), for Windows, Linux or macOS;
- an editor: volume 1 uses Visual Studio Code with the C# Dev Kit extension, and chapter I.0 explains it step by step, debugging included.
Running a program
From the terminal, in the program's folder:
cd I.19/Decimazione
dotnet run -c Release
The first run downloads the packages it needs (Avalonia and Skia for the programs with a window) and compiles; later runs start at once. -c Release matters for the programs that measure times, like the FFTs of chapter I.8 or the polyphase filters of chapter I.19: in Debug the compiler does not optimize and the times are not the book's.
The data of the plots
Many programs, besides printing their measurements, write the data of the book's plots to CSV files:
dotnet run -c Release -- dati folder
The files use the decimal point and the semicolon as separator, and open in a spreadsheet or any plotting program. The terminal output instead follows the computer's language: on an Italian Windows, the decimal comma.
Linked files
A chapter often uses the classes of earlier chapters: the decimation of chapter I.19 uses the FIR design of chapter I.13 and the windows of chapter I.9. The files are not copied: the .csproj links them with <Compile Include="..\..\I.13\Fir\Progetto.cs" Link="Progetto.cs" />. That is why a program's folder must stay inside the examples folder, with the others: moved alone, it no longer finds the files it links.
Code rules
The programs follow the rules of the series: Italian names, one class per file, a comment on every member, lines within 80 characters. There are no lambda functions: where a function passed as an argument would be needed there is a named method, which reads well and takes a breakpoint. The classes are internal, as in a real program; their reference is on the API page.
License
MIT: you may copy, modify and use them in your own commercial programs too, as long as the copyright notice stays (the LICENSE file in the examples folder).