<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Iraitz</title>
    <description>The latest articles on DEV Community by Iraitz (@iraitz).</description>
    <link>https://dev.to/iraitz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3486876%2F61a5f939-0dfc-4fcc-a230-2669b3a1a7cd.png</url>
      <title>DEV Community: Iraitz</title>
      <link>https://dev.to/iraitz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iraitz"/>
    <language>en</language>
    <item>
      <title>From Analog to Digital: Signal Simulation</title>
      <dc:creator>Iraitz</dc:creator>
      <pubDate>Mon, 08 Sep 2025 11:47:06 +0000</pubDate>
      <link>https://dev.to/iraitz/from-analog-to-digital-signal-simulation-m0j</link>
      <guid>https://dev.to/iraitz/from-analog-to-digital-signal-simulation-m0j</guid>
      <description>&lt;p&gt;In this project I made a simple simulation of how an analog signal becomes digital. The process has four main steps:&lt;/p&gt;

&lt;p&gt;1 ANALOG SIGNAL&lt;/p&gt;

&lt;p&gt;I start with a sine wave of 100 Hz.&lt;br&gt;
I use a very small time step, so the signal looks continuous.&lt;br&gt;
This is my reference “analog” signal.&lt;/p&gt;

&lt;p&gt;Result: a smooth curve, the original wave.&lt;/p&gt;

&lt;p&gt;2 SAMPLING&lt;/p&gt;

&lt;p&gt;The analog signal is sampled with different frequencies (Fs = 150, 200, 500, 1000 Hz).&lt;/p&gt;

&lt;p&gt;150 Hz (below Nyquist) → the samples are not enough, the signal looks distorted.&lt;/p&gt;

&lt;p&gt;200 Hz (at Nyquist) → the minimum frequency to capture the signal, but still not very clear.&lt;/p&gt;

&lt;p&gt;500 and 1000 Hz (above Nyquist) → the signal is represented much better.&lt;/p&gt;

&lt;p&gt;This shows the Nyquist theorem: the sampling frequency must be at least 2 times the signal frequency.&lt;/p&gt;

&lt;p&gt;3 QUANTIZATION&lt;/p&gt;

&lt;p&gt;After sampling, the amplitude of each point is mapped to a fixed number of levels.&lt;/p&gt;

&lt;p&gt;I tested 8, 16, and 64 levels.&lt;/p&gt;

&lt;p&gt;8 levels (3 bits) → very rough signal, steps are big.&lt;/p&gt;

&lt;p&gt;16 levels (4 bits) → better, but still visible distortion.&lt;/p&gt;

&lt;p&gt;64 levels (6 bits) → the signal looks smooth, very close to the original.&lt;/p&gt;

&lt;p&gt;More levels = higher accuracy, but also more bits are needed.&lt;/p&gt;

&lt;p&gt;4 SUMMARY&lt;/p&gt;

&lt;p&gt;The simulation shows the complete path:&lt;/p&gt;

&lt;p&gt;Analog → Sampling → Quantization → Digital Representation&lt;/p&gt;

&lt;p&gt;If sampling is too low → aliasing and distortion.&lt;/p&gt;

&lt;p&gt;If quantization levels are too low → the signal loses quality.&lt;/p&gt;

&lt;p&gt;Higher sampling and more levels → better quality, but more data to store or transmit.&lt;/p&gt;

&lt;p&gt;Here is the link to the code on GitHub: &lt;a href="https://github.com/IraitzMaritxalar/analog-to-digital-simulation" rel="noopener noreferrer"&gt;https://github.com/IraitzMaritxalar/analog-to-digital-simulation&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
