<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
    <title>Nezzontli - Physics</title>
    <subtitle>Bitácora personal de Alejandro B.E.: tecnología, física, sistemas resilientes y fotografía analógica.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://nezzontli.xyz/es/tags/physics/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://nezzontli.xyz"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-03-15T00:00:00+00:00</updated>
    <id>https://nezzontli.xyz/es/tags/physics/atom.xml</id>
    <entry xml:lang="es">
        <title>Reconstrucción de Sonido con Láser y Fotosensor: De la Teoría al Código</title>
        <published>2026-03-15T00:00:00+00:00</published>
        <updated>2026-03-15T00:00:00+00:00</updated>
        
        <author>
          <name>
            B.E. Alejandro
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nezzontli.xyz/es/blog/matlab/"/>
        <id>https://nezzontli.xyz/es/blog/matlab/</id>
        
        <content type="html" xml:base="https://nezzontli.xyz/es/blog/matlab/">&lt;h2 id=&quot;el-problema-puede-un-rayo-de-luz-transportar-sonido&quot;&gt;El Problema: ¿Puede un Rayo de Luz Transportar Sonido?&lt;&#x2F;h2&gt;
&lt;p&gt;La idea surgió de una pregunta aparentemente simple en clase de física: si el sonido es una onda mecánica que vibra el aire, ¿podría esa vibración modular un haz de luz y recuperarse después?&lt;&#x2F;p&gt;
&lt;p&gt;La respuesta es sí, y el principio es elegante. El sonido dentro de una caja insonorizada hace vibrar un panel de vidrio. Un láser de 650 nm apunta al vidrio desde afuera; el reflejo modulado por las vibraciones es capturado por un fotodiodo BPW34. La corriente fotoeléctrica resultante pasa por un amplificador de transimpedancia (TIA LM358) que la convierte en voltaje, luego por un MAX9814 con control de ganancia automático (AGC), y finalmente llega al jack de micrófono de la PC donde MATLAB la digitaliza y reconstruye el audio original:&lt;&#x2F;p&gt;
&lt;p&gt;$$V(t) = A \cdot \sin(2\pi f t) + \eta(t)$$&lt;&#x2F;p&gt;
&lt;p&gt;donde $\eta(t)$ es el ruido introducido por el sistema óptico-electrónico. El reto es precisamente ese: dado que $\eta(t)$ siempre existe, ¿cómo recuperamos la señal $A \cdot \sin(2\pi f t)$ con la mayor fidelidad posible?&lt;&#x2F;p&gt;
&lt;p&gt;Este post documenta la &lt;strong&gt;fase de simulación completa en MATLAB&lt;&#x2F;strong&gt; que valida los algoritmos antes de construir el hardware real.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;fundamentos-teoricos&quot;&gt;Fundamentos Teóricos&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;transformada-de-fourier-fft&quot;&gt;Transformada de Fourier (FFT)&lt;&#x2F;h3&gt;
&lt;p&gt;El teorema de Fourier establece que cualquier señal periódica puede descomponerse como suma de senos y cosenos. La Transformada de Fourier Discreta (DFT) hace esto numéricamente:&lt;&#x2F;p&gt;
&lt;p&gt;$$X[k] = \sum_{n=0}^{N-1} x[n] \cdot e^{-j2\pi kn&#x2F;N}$$&lt;&#x2F;p&gt;
&lt;p&gt;La &lt;strong&gt;FFT&lt;&#x2F;strong&gt; (Fast Fourier Transform) es un algoritmo eficiente para calcular la DFT en $O(N \log N)$ en lugar de $O(N^2)$. Para este proyecto, la FFT cumple dos funciones:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Identificar&lt;&#x2F;strong&gt; qué frecuencias componen la señal capturada&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Filtrar&lt;&#x2F;strong&gt; el ruido eliminando componentes espectrales débiles&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;descomposicion-en-valores-singulares-svd&quot;&gt;Descomposición en Valores Singulares (SVD)&lt;&#x2F;h3&gt;
&lt;p&gt;Dado que el proyecto conecta con el tema de &lt;em&gt;espacios vectoriales&lt;&#x2F;em&gt; del semestre, también apliqué SVD para analizar la estructura de cada señal. Dada una matriz de trayectoria $M$ construida a partir de la señal:&lt;&#x2F;p&gt;
&lt;p&gt;$$M = U \cdot \Sigma \cdot V^T$$&lt;&#x2F;p&gt;
&lt;p&gt;Los valores singulares $\sigma_i$ en $\Sigma$ revelan cuántos “modos independientes” necesita la señal para representarse. Una señal simple (tono puro) tiene muy pocos valores singulares grandes; una señal compleja los tiene distribuidos.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
	&lt;p&gt;&lt;strong&gt;Conexión con el curso:&lt;&#x2F;strong&gt; El SVD es esencialmente un cambio de base ortogonal. Los vectores columna de $U$ son la nueva base en el espacio de la señal, y los valores singulares son las “coordenadas” de importancia de cada vector base. Exactamente el mismo concepto de base ortonormal que vimos en clase.&lt;&#x2F;p&gt;

&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;el-hardware&quot;&gt;El Hardware&lt;&#x2F;h2&gt;
&lt;p&gt;El sistema físico que se simulará y construirá está formado por los siguientes componentes, elegidos por su precisión y bajo ruido:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Componente&lt;&#x2F;th&gt;&lt;th&gt;Función&lt;&#x2F;th&gt;&lt;th&gt;Parámetro clave&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Láser D18×65mm 650nm 5mW&lt;&#x2F;td&gt;&lt;td&gt;Fuente de luz, punto continuo&lt;&#x2F;td&gt;&lt;td&gt;Enfocable, montado en soporte Neiko ~30°&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;BPW34 (fotodiodo PIN)&lt;&#x2F;td&gt;&lt;td&gt;Luz → corriente&lt;&#x2F;td&gt;&lt;td&gt;R = 0.3 A&#x2F;W @ 650 nm, en tubo negro&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;LM358 (TIA)&lt;&#x2F;td&gt;&lt;td&gt;Corriente → voltaje&lt;&#x2F;td&gt;&lt;td&gt;Rf = 10 kΩ, Cf = 100 pF&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Capacitor C_ac 10 µF&lt;&#x2F;td&gt;&lt;td&gt;Bloqueo de offset DC&lt;&#x2F;td&gt;&lt;td&gt;fc = 1.6 Hz&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;MAX9814 HiLetgo&lt;&#x2F;td&gt;&lt;td&gt;Amplificador AGC&lt;&#x2F;td&gt;&lt;td&gt;Av = 40 dB (GAIN flotante)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Capacitor C_sal 47 µF&lt;&#x2F;td&gt;&lt;td&gt;Bloqueo offset salida&lt;&#x2F;td&gt;&lt;td&gt;fc = 0.34 Hz&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Módulo Jack ShillehTek 3.5mm&lt;&#x2F;td&gt;&lt;td&gt;Interfaz PC&lt;&#x2F;td&gt;&lt;td&gt;Entrada micrófono, breakout TRRS&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;ESP32&lt;&#x2F;td&gt;&lt;td&gt;Fuente de alimentación 5V&lt;&#x2F;td&gt;&lt;td&gt;Pin VIN → rail protoboard&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Soporte Neiko&lt;&#x2F;td&gt;&lt;td&gt;Posicionar láser en ángulo&lt;&#x2F;td&gt;&lt;td&gt;Ajuste ~30° sobre el vidrio&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;La ventaja principal del BPW34 sobre un LDR es su tiempo de respuesta: 20 ns frente a ~1 ms, permitiendo capturar audio hasta 20 kHz sin ninguna degradación por el sensor.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;diagrama-del-circuito&quot;&gt;Diagrama del circuito&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;github.com&#x2F;Richard7987&#x2F;Proyecto-Fisica-2do&#x2F;raw&#x2F;main&#x2F;Imagenes&#x2F;Diagrama%20de%20Circuito%20%E2%80%94%20Microfono%20Laser.png&quot; alt=&quot;Diagrama de circuito completo: BPW34 → TIA LM358 → MAX9814 → Jack PC&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;montaje-experimental&quot;&gt;Montaje experimental&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;github.com&#x2F;Richard7987&#x2F;Proyecto-Fisica-2do&#x2F;raw&#x2F;main&#x2F;Imagenes&#x2F;Simulacion%203D%20%E2%80%94%20Microfono%20Laser.png&quot; alt=&quot;Simulacion 3D animada del montaje experimental completo&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;La escena 3D muestra el montaje completo: caja insonorizada con vidrio vibrante, láser industrial D18×65 mm sobre soporte Neiko apuntando al vidrio en ~30°, BPW34 en tubo negro en el ángulo de reflexión especular, y el circuito completo (ESP32 + LM358 + MAX9814 + módulo jack) en la protoboard. La animación sincroniza la vibración del vidrio con las señales en tiempo real en cada etapa del pipeline.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;metodologia-de-simulacion&quot;&gt;Metodología de Simulación&lt;&#x2F;h2&gt;
&lt;p&gt;Para validar los algoritmos sin hardware, generé cuatro tipos de señal en MATLAB y simulé el proceso completo con el pipeline óptico-electrónico real: generación → modulación óptica → BPW34 → TIA → MAX9814 → filtrado FFT → reconstrucción → validación.&lt;&#x2F;p&gt;
&lt;p&gt;A diferencia de simplemente sumar ruido gaussiano, el modelo simula la cadena física completa:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;matlab&quot; class=&quot;language-matlab z-code&quot;&gt;&lt;code class=&quot;language-matlab&quot; data-lang=&quot;matlab&quot;&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;&lt;span class=&quot;z-keyword z-other z-matlab&quot;&gt;function&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-output z-function z-matlab&quot;&gt;v_out&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-matlab&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function z-parameters z-matlab&quot;&gt; &lt;span class=&quot;z-entity z-name z-function z-matlab&quot;&gt;pipeline_sensor&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;audio&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-matlab&quot;&gt;,&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;P_laser&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-matlab&quot;&gt;,&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;mod_depth&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-matlab&quot;&gt;,&lt;&#x2F;span&gt; ...
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;&lt;span class=&quot;z-meta z-function z-parameters z-matlab&quot;&gt;                                 &lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;R_bpw34&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-matlab&quot;&gt;,&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;Rf_TIA&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-matlab&quot;&gt;,&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;Av_MAX&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-matlab&quot;&gt;,&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;ruido&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; 1. Modulacion optica: el vidrio vibrante modula el reflejo
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;P_luz&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;  = &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;P_laser&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; + &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mod_depth&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;audio&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; 2. BPW34: fotocorriente = responsividad x potencia + shot noise
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;I_foto&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; = &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;R_bpw34&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;P_luz&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; + &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;ruido&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1e-4&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;randn&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;size&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;audio&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; 3. TIA LM358: I → V, eliminar offset DC (como el capacitor C_ac)
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_tia&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;  = &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;I_foto&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;Rf_TIA&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_tia&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;  = &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_tia&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; - &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;mean&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_tia&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; 4. MAX9814: amplificar y saturar (±1.65V)
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_max&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;  = &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;Av_MAX&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_tia&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;v_out&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;  = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;max&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;-&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1.65&lt;&#x2F;span&gt;, &lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;min&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1.65&lt;&#x2F;span&gt;, &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;V_max&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;&lt;span class=&quot;z-keyword z-control z-matlab&quot;&gt;end&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;El ruido del BPW34 (shot noise) es de apenas 0.8% de la señal — notablemente menor que el 5% típico de un LDR, lo que explica los resultados de SNR superiores.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;las-cuatro-senales-de-prueba&quot;&gt;Las Cuatro Señales de Prueba&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Señal&lt;&#x2F;th&gt;&lt;th&gt;Frecuencias&lt;&#x2F;th&gt;&lt;th&gt;Por qué es interesante&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Tono puro&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;1000 Hz&lt;&#x2F;td&gt;&lt;td&gt;Caso base, señal más simple posible&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Acorde Do Mayor&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;262 + 330 + 392 Hz&lt;&#x2F;td&gt;&lt;td&gt;Tres frecuencias simultáneas (Do, Mi, Sol)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Barrido (chirp)&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;100 → 1000 Hz&lt;&#x2F;td&gt;&lt;td&gt;Frecuencia variable en el tiempo&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Señal compleja&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;262·k Hz, k=1..5&lt;&#x2F;td&gt;&lt;td&gt;Serie armónica, simula voz humana&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h3 id=&quot;el-algoritmo-de-reconstruccion&quot;&gt;El Algoritmo de Reconstrucción&lt;&#x2F;h3&gt;
&lt;p&gt;El núcleo del sistema es el filtrado espectral: se aplica una máscara binaria al espectro FFT que conserva solo las componentes que superan el 10% del pico máximo, luego se reconstruye la señal con la IFFT. La clave es mantener la &lt;strong&gt;simetría hermitiana&lt;&#x2F;strong&gt; del espectro para que la IFFT devuelva valores reales:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;matlab&quot; class=&quot;language-matlab z-code&quot;&gt;&lt;code class=&quot;language-matlab&quot; data-lang=&quot;matlab&quot;&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;&lt;span class=&quot;z-keyword z-other z-matlab&quot;&gt;function&lt;&#x2F;span&gt; &lt;span class=&quot;z-variable z-parameter z-output z-function z-matlab&quot;&gt;senial_rec&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-assignment z-matlab&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function z-parameters z-matlab&quot;&gt; &lt;span class=&quot;z-entity z-name z-function z-matlab&quot;&gt;reconstruir_por_fft&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-parameter z-input z-function z-matlab&quot;&gt;senial_ruidosa&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;        = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;length&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;senial_ruidosa&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;Y&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;        = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;fft&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;senial_ruidosa&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; Magnitud del espectro unilateral (DC hasta Nyquist inclusive)
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mag_pos&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;  = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;abs&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;Y&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; : &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;floor&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; + &lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;umbral&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;   = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;max&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mag_pos&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; * &lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;0.1&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; Máscara binaria: 1 donde la señal supera el umbral
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara_pos&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; = &lt;&#x2F;span&gt;&lt;span class=&quot;z-storage z-type z-matlab&quot;&gt;double&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mag_pos&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; &amp;gt; &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;umbral&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-comment z-line z-percentage z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-matlab&quot;&gt;%&lt;&#x2F;span&gt; Máscara completa con simetría hermitiana para señal real
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;zeros&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;, &lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; : &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;floor&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; + &lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;1&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;   = &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara_pos&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;floor&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;+&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; : &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;     = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;flipud&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara_pos&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; : &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;floor&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;N&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-matlab&quot;&gt;2&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;    &lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;senial_rec&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; = &lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-mathematics z-matlab&quot;&gt;real&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-analysis z-matlab&quot;&gt;ifft&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-parens z-matlab&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-begin z-matlab&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;Y&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-symbols z-matlab&quot;&gt; .* &lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-variable z-other z-valid z-matlab&quot;&gt;mascara&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-parens z-end z-matlab&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-matlab&quot;&gt;&lt;span class=&quot;z-keyword z-control z-matlab&quot;&gt;end&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote class=&quot;markdown-alert-important&quot;&gt;
	&lt;p&gt;&lt;strong&gt;Error que cometí:&lt;&#x2F;strong&gt; En versiones anteriores usé &lt;code&gt;N&#x2F;2&lt;&#x2F;code&gt; directamente para indexar, lo que fallaba cuando &lt;code&gt;N&lt;&#x2F;code&gt; es impar. La solución correcta es &lt;code&gt;floor(N&#x2F;2)&lt;&#x2F;code&gt; en todos los índices, y construir la simetría conjugada explícitamente. Esto asegura que la máscara tenga exactamente &lt;code&gt;N&lt;&#x2F;code&gt; elementos sin importar la paridad de la longitud de la señal.&lt;&#x2F;p&gt;

&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;resultados&quot;&gt;Resultados&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;graficas-completas&quot;&gt;Gráficas Completas&lt;&#x2F;h3&gt;
&lt;p&gt;La siguiente figura muestra el pipeline completo para las cuatro señales: señal ideal → señal capturada por el sensor (BPW34→MAX9814) → señal reconstruida → espectro FFT con el SNR obtenido.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;github.com&#x2F;Richard7987&#x2F;Proyecto-Fisica-2do&#x2F;raw&#x2F;main&#x2F;Imagenes&#x2F;Sistema%20Laser-Fotosensor%20%E2%80%94%20Resultados%20Completos.png&quot; alt=&quot;Pipeline completo para las 4 señales de prueba: ideal, capturada, reconstruida y espectro FFT&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Lo más notable visualmente: la columna “Reconstruido” (verde) recupera la forma de onda con una fidelidad que hace casi indistinguible el resultado del original, a pesar del ruido visible en la columna “Capturado”.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;metricas-cuantitativas&quot;&gt;Métricas Cuantitativas&lt;&#x2F;h3&gt;
&lt;p&gt;Para no quedarme solo con la inspección visual, calculé tres métricas de error para cada señal. La señal reconstruida se escala antes de comparar (producto interno mínimo cuadrados) para separar el error de fase&#x2F;forma del error de amplitud:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Señal&lt;&#x2F;th&gt;&lt;th&gt;Error RMS&lt;&#x2F;th&gt;&lt;th&gt;SNR (dB)&lt;&#x2F;th&gt;&lt;th&gt;Correlación&lt;&#x2F;th&gt;&lt;th&gt;Resultado&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Tono puro&lt;&#x2F;td&gt;&lt;td&gt;2.79 × 10⁻⁶&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;102.1 dB&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;1.0000&lt;&#x2F;td&gt;&lt;td&gt;Excelente&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Acorde&lt;&#x2F;td&gt;&lt;td&gt;2.87 × 10⁻⁴&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;62.1 dB&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;1.0000&lt;&#x2F;td&gt;&lt;td&gt;Excelente&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Barrido&lt;&#x2F;td&gt;&lt;td&gt;1.06 × 10⁻²&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;30.5 dB&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;0.9996&lt;&#x2F;td&gt;&lt;td&gt;Muy bueno&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Compleja&lt;&#x2F;td&gt;&lt;td&gt;3.00 × 10⁻⁴&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;63.1 dB&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;1.0000&lt;&#x2F;td&gt;&lt;td&gt;Excelente&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
	&lt;p&gt;&lt;strong&gt;Referencia:&lt;&#x2F;strong&gt; En audio, un SNR por encima de 20 dB ya es considerado aceptable para reproducción de voz. Por encima de 40 dB es transparente para el oído humano en la mayoría de condiciones. Los resultados de este sistema están entre 30.5 y 102.1 dB.&lt;&#x2F;p&gt;

&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;analisis-svd&quot;&gt;Análisis SVD&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;github.com&#x2F;Richard7987&#x2F;Proyecto-Fisica-2do&#x2F;raw&#x2F;main&#x2F;Imagenes&#x2F;Analisis%20SVD%20%E2%80%94%20Espacios%20Vectoriales.png&quot; alt=&quot;Descomposicion SVD de la matriz de trayectoria para las 4 señales&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;El análisis de valores singulares confirma la intuición teórica sobre la complejidad de cada señal:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Señal&lt;&#x2F;th&gt;&lt;th&gt;Varianza acumulada en 5 modos&lt;&#x2F;th&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Tono puro&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;99.0%&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;casi toda la energía en 1–2 modos&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Acorde&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;84.3%&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;~3 modos significativos (uno por frecuencia)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Barrido&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;9.3%&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;energía muy distribuida&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Compleja&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;88.6%&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;varios modos (armónicos)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;El caso del barrido es el más revelador: como la frecuencia cambia continuamente de 100 a 1000 Hz durante 3 segundos, ningún modo fijo puede capturar bien la señal. Necesita cientos de vectores singulares para representarse fielmente. Esto explica matemáticamente por qué tiene el SNR más bajo: el filtro FFT de umbral fijo no es el mejor para señales variantes en el tiempo.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;el-codigo-completo&quot;&gt;El Código Completo&lt;&#x2F;h2&gt;
&lt;p&gt;El script completo está disponible en el repositorio del proyecto:&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
	&lt;p&gt;&lt;strong&gt;Código fuente:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Richard7987&#x2F;Proyecto-Fisica-2do&#x2F;blob&#x2F;main&#x2F;Scripts&#x2F;script_prueba_demostracion.m&quot;&gt;script_prueba_demostracion.m&lt;&#x2F;a&gt; — MATLAB R2016b o superior, requiere Signal Processing Toolbox.&lt;&#x2F;p&gt;

&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;conclusiones&quot;&gt;Conclusiones&lt;&#x2F;h2&gt;
&lt;p&gt;Los resultados de la simulación son claros:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;El filtrado espectral FFT funciona.&lt;&#x2F;strong&gt; SNR de hasta 102.1 dB para el tono puro y correlación de 1.0000 en tres de las cuatro señales. El sistema recupera la forma de onda con fidelidad suficiente para reproducción de audio.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;La señal más difícil es el barrido (chirp).&lt;&#x2F;strong&gt; Con 30.5 dB y correlación 0.9996, sigue siendo muy buena, pero revela la limitación del filtro de umbral fijo: no es el mejor para señales cuya frecuencia varía en el tiempo. La &lt;strong&gt;STFT&lt;&#x2F;strong&gt; (Short-Time Fourier Transform) o una transformada Wavelet serían mejores herramientas para ese caso.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;El SVD confirma la teoría de espacios vectoriales.&lt;&#x2F;strong&gt; El rango efectivo de la señal (medido por los valores singulares) refleja directamente su complejidad: 1–2 modos para el tono puro, cientos para el barrido.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;El BPW34 supera al LDR.&lt;&#x2F;strong&gt; El shot noise del BPW34 es de apenas 0.8% de la señal, frente al 5% típico de un LDR. Esto se traduce directamente en SNR más alto y reconstrucción más fiel.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;La simulación valida la arquitectura antes del hardware.&lt;&#x2F;strong&gt; Ya sé que los algoritmos funcionan. Ahora puedo construir el sistema real con confianza.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;proximos-pasos&quot;&gt;Próximos Pasos&lt;&#x2F;h2&gt;
&lt;p&gt;El hardware está definido y en camino:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Montaje físico:&lt;&#x2F;strong&gt; láser D18×65mm sobre soporte Neiko, BPW34 en tubo negro, circuito en protoboard 830 puntos&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Primera captura real:&lt;&#x2F;strong&gt; comparar SNR experimental con el simulado (objetivo: &amp;gt;20 dB)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Señales de prueba:&lt;&#x2F;strong&gt; tono puro de generador, luego voz, luego música&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Futuro:&lt;&#x2F;strong&gt; STFT para mejorar la reconstrucción del chirp y señales variantes en el tiempo&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;El siguiente post documentará la construcción del hardware y la primera captura real de audio.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;&lt;em&gt;Este proyecto es parte del curso de Física II (Ondas, Oscilaciones y Espacios Vectoriales), segundo semestre. Todo el código es de acceso libre en &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Richard7987&#x2F;Proyecto-Fisica-2do.git&quot;&gt;GitHub&lt;&#x2F;a&gt;.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="es">
        <title>Double Slit Experiment Simulation</title>
        <published>2025-10-28T00:00:00+00:00</published>
        <updated>2025-10-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            B.E. Alejandro
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nezzontli.xyz/es/blog/proy2/"/>
        <id>https://nezzontli.xyz/es/blog/proy2/</id>
        
        <content type="html" xml:base="https://nezzontli.xyz/es/blog/proy2/">&lt;h1 id=&quot;double-slit-experiment-simulation-project&quot;&gt;Double Slit Experiment Simulation Project&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;&#x2F;h2&gt;
&lt;p&gt;This project presents a comprehensive computational simulation of the famous &lt;strong&gt;double-slit experiment&lt;&#x2F;strong&gt;, one of the most profound demonstrations in quantum mechanics. The simulation is designed to run on a Raspberry Pi and includes four different visualization modes, each revealing different aspects of wave-particle duality and quantum behavior.&lt;&#x2F;p&gt;
&lt;p&gt;The double-slit experiment, originally performed by Thomas Young in 1801, demonstrates that light and matter exhibit both wave-like and particle-like properties. This project brings this fundamental quantum phenomenon to life through interactive Python simulations.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;the-four-simulations&quot;&gt;The Four Simulations&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-basic-simulation-static-interference-pattern&quot;&gt;1. Basic Simulation - Static Interference Pattern&lt;&#x2F;h3&gt;
&lt;p&gt;The basic simulation displays the classic interference pattern produced when coherent waves pass through two slits. This visualization shows the fundamental wave behavior with bright fringes (constructive interference) and dark fringes (destructive interference).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Features:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Static interference pattern visualization&lt;&#x2F;li&gt;
&lt;li&gt;Heat map showing intensity distribution&lt;&#x2F;li&gt;
&lt;li&gt;Marked slit positions&lt;&#x2F;li&gt;
&lt;li&gt;Clear demonstration of wave superposition&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Visual Result:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;a href=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_basica.png&quot; data-rybbit-event=&quot;photo_original_viewed&quot; data-rybbit-prop-path=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_basica.png&quot;&gt;
	&lt;img class=&quot;landscape&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_basica.db35fa7697ec25bf.png&quot; srcset=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_basica.c78bd4ea55bbfe19.png 480w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_basica.0b7a1bd2d32f9104.png 960w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_basica.db35fa7697ec25bf.png 1440w&quot; sizes=&quot;(max-width: 800px) 90vw, 45rem&quot; alt=&quot;Basic Simulation&quot; width=&quot;1440&quot; height=&quot;994&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; &#x2F;&gt;
&lt;&#x2F;a&gt;
&lt;p&gt;The image shows multiple bright and dark bands, demonstrating how waves from both slits interfere with each other. The cyan stars mark the positions of the two slits.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h3 id=&quot;2-animated-simulation-waves-in-motion&quot;&gt;2. Animated Simulation - Waves in Motion&lt;&#x2F;h3&gt;
&lt;p&gt;This is the most visually striking simulation, showing waves propagating in real-time from both slits. The animation provides an intuitive understanding of how interference patterns form dynamically.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Features:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Real-time wave propagation animation&lt;&#x2F;li&gt;
&lt;li&gt;Two-panel display: wave amplitude and intensity&lt;&#x2F;li&gt;
&lt;li&gt;Color-coded visualization (red = wave crests, blue = wave troughs)&lt;&#x2F;li&gt;
&lt;li&gt;Continuous animation showing wave evolution&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Visual Result:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;a href=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_animada.png&quot; data-rybbit-event=&quot;photo_original_viewed&quot; data-rybbit-prop-path=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_animada.png&quot;&gt;
	&lt;img class=&quot;landscape&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_animada.e94536631445ded6.png&quot; srcset=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_animada.e35705ba36562983.png 480w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_animada.19a3221ef4262f9f.png 960w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_animada.e94536631445ded6.png 1440w&quot; sizes=&quot;(max-width: 800px) 90vw, 45rem&quot; alt=&quot;Animated Simulation&quot; width=&quot;1440&quot; height=&quot;568&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; &#x2F;&gt;
&lt;&#x2F;a&gt;
&lt;p&gt;The left panel shows the wave amplitude with red and blue colors representing crests and valleys. The right panel displays the observable intensity pattern that would be detected on a screen.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h3 id=&quot;3-interactive-simulation-parameter-exploration&quot;&gt;3. Interactive Simulation - Parameter Exploration&lt;&#x2F;h3&gt;
&lt;p&gt;The interactive simulation allows real-time adjustment of experimental parameters, providing hands-on exploration of how wavelength and slit separation affect the interference pattern.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Features:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Adjustable wavelength (λ) slider&lt;&#x2F;li&gt;
&lt;li&gt;Adjustable slit separation (d) slider&lt;&#x2F;li&gt;
&lt;li&gt;Toggle between 1 and 2 slits&lt;&#x2F;li&gt;
&lt;li&gt;Real-time intensity profile graph&lt;&#x2F;li&gt;
&lt;li&gt;Display of Young’s formula: Δy = λL&#x2F;d&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Visual Result:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;a href=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_interactiva.png&quot; data-rybbit-event=&quot;photo_original_viewed&quot; data-rybbit-prop-path=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_interactiva.png&quot;&gt;
	&lt;img class=&quot;landscape&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_interactiva.efe37d0e20b2353f.png&quot; srcset=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_interactiva.b31e4052bb643289.png 480w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_interactiva.3d4f723ce9b1878d.png 960w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_interactiva.efe37d0e20b2353f.png 1440w&quot; sizes=&quot;(max-width: 800px) 90vw, 45rem&quot; alt=&quot;Interactive Simulation&quot; width=&quot;1440&quot; height=&quot;1004&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; &#x2F;&gt;
&lt;&#x2F;a&gt;
&lt;p&gt;The simulation shows both the 2D interference pattern and a 1D intensity profile, with interactive controls at the bottom for parameter adjustment.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h3 id=&quot;4-quantum-simulation-the-observer-effect&quot;&gt;4. Quantum Simulation - The Observer Effect&lt;&#x2F;h3&gt;
&lt;p&gt;This is the most impressive and conceptually profound simulation. It demonstrates the quantum mechanical observer effect: the phenomenon where the act of measurement fundamentally changes the behavior of quantum particles.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Features:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Individual particle detection simulation&lt;&#x2F;li&gt;
&lt;li&gt;“OBSERVE” button to toggle measurement&lt;&#x2F;li&gt;
&lt;li&gt;Side-by-side comparison of theoretical and experimental patterns&lt;&#x2F;li&gt;
&lt;li&gt;Accumulation of particle detections over time&lt;&#x2F;li&gt;
&lt;li&gt;Clear demonstration of wave function collapse&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Visual Result:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;a href=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_cuantica.png&quot; data-rybbit-event=&quot;photo_original_viewed&quot; data-rybbit-prop-path=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_cuantica.png&quot;&gt;
	&lt;img class=&quot;landscape&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_cuantica.4eadcd3ce7732490.png&quot; srcset=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_cuantica.a02196ce9868d7df.png 480w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_cuantica.255d8f09d6381582.png 960w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_cuantica.4eadcd3ce7732490.png 1440w&quot; sizes=&quot;(max-width: 800px) 90vw, 45rem&quot; alt=&quot;Quantum Simulation&quot; width=&quot;1440&quot; height=&quot;581&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; &#x2F;&gt;
&lt;&#x2F;a&gt;
&lt;p&gt;The left panel shows the theoretical probability distribution, while the right panel accumulates individual particle detections. When observation is activated, the interference pattern disappears.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;the-observer-effect-the-heart-of-quantum-mechanics&quot;&gt;The Observer Effect - The Heart of Quantum Mechanics&lt;&#x2F;h2&gt;
&lt;p&gt;The most striking result of this project is the demonstration of how observation changes quantum behavior:&lt;&#x2F;p&gt;
&lt;a href=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;comparacion_observador_simple.png&quot; data-rybbit-event=&quot;photo_original_viewed&quot; data-rybbit-prop-path=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;comparacion_observador_simple.png&quot;&gt;
	&lt;img class=&quot;landscape&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;comparacion_observador_simple.5d1bf519bf25b215.png&quot; srcset=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;comparacion_observador_simple.cc3bc3d4184a595c.png 480w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;comparacion_observador_simple.e984e8b7850dce62.png 960w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;comparacion_observador_simple.5d1bf519bf25b215.png 1440w&quot; sizes=&quot;(max-width: 800px) 90vw, 45rem&quot; alt=&quot;Observer Effect Comparison&quot; width=&quot;1440&quot; height=&quot;626&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; &#x2F;&gt;
&lt;&#x2F;a&gt;
&lt;h3 id=&quot;without-observation-left-blue&quot;&gt;Without Observation (Left - Blue):&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multiple interference fringes&lt;&#x2F;strong&gt; appear&lt;&#x2F;li&gt;
&lt;li&gt;Each particle behaves as a &lt;strong&gt;wave&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;The particle passes through &lt;strong&gt;both slits simultaneously&lt;&#x2F;strong&gt; (quantum superposition)&lt;&#x2F;li&gt;
&lt;li&gt;Result: &lt;strong&gt;Interference pattern&lt;&#x2F;strong&gt; with 6-8 visible bands&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;with-observation-right-red&quot;&gt;With Observation (Right - Red):&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Only 2 bands&lt;&#x2F;strong&gt; appear&lt;&#x2F;li&gt;
&lt;li&gt;Each particle behaves as a &lt;strong&gt;classical particle&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;The particle “chooses” &lt;strong&gt;one specific slit&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Result: &lt;strong&gt;No interference&lt;&#x2F;strong&gt; - just two separate distributions&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This is the central mystery of quantum mechanics: &lt;strong&gt;the act of observing changes reality itself&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;complete-comparison&quot;&gt;Complete Comparison&lt;&#x2F;h2&gt;
&lt;p&gt;All four simulations side by side:&lt;&#x2F;p&gt;
&lt;a href=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_comparacion.png&quot; data-rybbit-event=&quot;photo_original_viewed&quot; data-rybbit-prop-path=&quot;&amp;#x2F;images&amp;#x2F;sim&amp;#x2F;captura_comparacion.png&quot;&gt;
	&lt;img class=&quot;landscape&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_comparacion.4ad03e503855a3db.png&quot; srcset=&quot;https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_comparacion.2308c7147f7d5cae.png 480w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_comparacion.3bda849d04bba17f.png 960w, https:&amp;#x2F;&amp;#x2F;nezzontli.xyz&amp;#x2F;processed_images&amp;#x2F;captura_comparacion.4ad03e503855a3db.png 1440w&quot; sizes=&quot;(max-width: 800px) 90vw, 45rem&quot; alt=&quot;All Simulations Comparison&quot; width=&quot;1440&quot; height=&quot;1283&quot; decoding=&quot;async&quot; loading=&quot;lazy&quot; &#x2F;&gt;
&lt;&#x2F;a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Top Left:&lt;&#x2F;strong&gt; Basic static pattern&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Top Right:&lt;&#x2F;strong&gt; Animated wave propagation&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Bottom Left:&lt;&#x2F;strong&gt; Interactive with adjustable parameters&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Bottom Right:&lt;&#x2F;strong&gt; Quantum simulation with probability distribution&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;physics-explained&quot;&gt;Physics Explained&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;wave-behavior-classical-physics&quot;&gt;Wave Behavior (Classical Physics)&lt;&#x2F;h3&gt;
&lt;p&gt;When light passes through two slits, each slit acts as a new source of circular waves (Huygens’ Principle). These waves overlap and interfere:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Constructive Interference:&lt;&#x2F;strong&gt; Wave crests align → bright fringe&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Destructive Interference:&lt;&#x2F;strong&gt; Crest meets trough → dark fringe&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The spacing between fringes follows Young’s formula:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Δy = λL&#x2F;d&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Where:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;λ = wavelength of light&lt;&#x2F;li&gt;
&lt;li&gt;L = distance to screen&lt;&#x2F;li&gt;
&lt;li&gt;d = separation between slits&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;quantum-behavior&quot;&gt;Quantum Behavior&lt;&#x2F;h3&gt;
&lt;p&gt;The quantum version reveals three fundamental principles:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Wave-Particle Duality:&lt;&#x2F;strong&gt; Quantum entities exhibit both wave and particle properties depending on how they are observed.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quantum Superposition:&lt;&#x2F;strong&gt; An unobserved particle exists in multiple states simultaneously. In the double-slit experiment, each particle passes through both slits at once.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Wave Function Collapse:&lt;&#x2F;strong&gt; When we measure which slit a particle passes through, the wave function collapses. The particle is forced to “choose” one path, and the interference pattern disappears.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;As physicist Richard Feynman stated:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“The double-slit experiment contains the only mystery of quantum mechanics.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;technical-implementation&quot;&gt;Technical Implementation&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hardware:&lt;&#x2F;strong&gt; Raspberry Pi (any model with Python 3)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Language:&lt;&#x2F;strong&gt; Python 3&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Libraries:&lt;&#x2F;strong&gt; NumPy (numerical computation), Matplotlib (visualization)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;installation&quot;&gt;Installation&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;pip3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; install numpy matplotlib&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;execution&quot;&gt;Execution&lt;&#x2F;h3&gt;
&lt;p&gt;Each simulation can be run independently:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;python3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; simulacion_basica.py      &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Basic simulation&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;python3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; simulacion_animada.py     &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Animated simulation&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;python3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; simulacion_interactiva.py &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Interactive simulation&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;python3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; simulacion_cuantica.py    &lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-begin z-shell&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt; Quantum simulation&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-shell&quot;&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;recommended-presentation-order&quot;&gt;Recommended Presentation Order&lt;&#x2F;h2&gt;
&lt;p&gt;For maximum impact in a physics competition:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Start with Animated Simulation&lt;&#x2F;strong&gt; - Captures attention with visual movement&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Continue with Interactive Simulation&lt;&#x2F;strong&gt; - Demonstrates understanding of parameters&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Finish with Quantum Simulation&lt;&#x2F;strong&gt; - Delivers the “wow” moment with the observer effect&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;project-significance&quot;&gt;Project Significance&lt;&#x2F;h2&gt;
&lt;p&gt;This project successfully demonstrates:&lt;&#x2F;p&gt;
&lt;p&gt;✅ &lt;strong&gt;Classical wave interference&lt;&#x2F;strong&gt; through computational modeling&lt;br &#x2F;&gt;
✅ &lt;strong&gt;Quantum superposition&lt;&#x2F;strong&gt; and wave function behavior&lt;br &#x2F;&gt;
✅ &lt;strong&gt;The observer effect&lt;&#x2F;strong&gt; - measurement changing reality&lt;br &#x2F;&gt;
✅ &lt;strong&gt;Interactive parameter exploration&lt;&#x2F;strong&gt; of physical phenomena&lt;br &#x2F;&gt;
✅ &lt;strong&gt;Real-time visualization&lt;&#x2F;strong&gt; of abstract quantum concepts&lt;&#x2F;p&gt;
&lt;p&gt;The simulations make abstract quantum mechanics concepts tangible and visually accessible, providing an excellent educational tool for understanding one of physics’ most profound experiments.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;educational-value&quot;&gt;Educational Value&lt;&#x2F;h2&gt;
&lt;p&gt;This project bridges the gap between theoretical quantum mechanics and practical visualization. It allows students and audiences to:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;See&lt;&#x2F;strong&gt; wave interference in action&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Explore&lt;&#x2F;strong&gt; how parameters affect patterns&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Understand&lt;&#x2F;strong&gt; the quantum measurement problem&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Experience&lt;&#x2F;strong&gt; the strangeness of quantum behavior&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The double-slit experiment has been called “the most beautiful experiment in physics” by Physics World readers. This simulation brings that beauty to life in an interactive, programmable format.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;The double-slit experiment simulation project successfully demonstrates the fundamental principles of quantum mechanics through four complementary visualizations. From the basic interference pattern to the profound observer effect, each simulation reveals a different facet of wave-particle duality.&lt;&#x2F;p&gt;
&lt;p&gt;The project proves that complex quantum phenomena can be effectively simulated and visualized using accessible technology like the Raspberry Pi, making cutting-edge physics education available to everyone.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Takeaway:&lt;&#x2F;strong&gt; Quantum mechanics shows us that nature behaves fundamentally differently at the microscopic scale. The act of observation is not passive - it actively participates in creating the reality we measure. This project makes that profound truth visible and interactive.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;&lt;strong&gt;Project Created By:&lt;&#x2F;strong&gt; B.E. Alejandro&lt;br &#x2F;&gt;
&lt;strong&gt;Technology:&lt;&#x2F;strong&gt; Python 3, NumPy, Matplotlib&lt;br &#x2F;&gt;
&lt;strong&gt;Platform:&lt;&#x2F;strong&gt; Raspberry Pi&lt;br &#x2F;&gt;
&lt;strong&gt;Purpose:&lt;&#x2F;strong&gt; Physics Competition &#x2F; Educational Demonstration&lt;br &#x2F;&gt;
&lt;strong&gt;Date:&lt;&#x2F;strong&gt; October 2025&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
