<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DSP on Matias Di Bernardo</title><link>https://dibernardo.netlify.app/categories/dsp/</link><description>Recent content in DSP on Matias Di Bernardo</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Matías Di Bernardo</copyright><lastBuildDate>Fri, 09 May 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://dibernardo.netlify.app/categories/dsp/index.xml" rel="self" type="application/rss+xml"/><item><title>Acoustic measurement at Usina del Arte</title><link>https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/</link><pubDate>Fri, 09 May 2025 00:00:00 +0000</pubDate><guid>https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/</guid><description>&lt;img src="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/portadix.jpg" alt="Featured image of post Acoustic measurement at Usina del Arte" />&lt;h3 id="introduction">&lt;strong>Introduction&lt;/strong>
&lt;/h3>&lt;p>This measurement was part of the course &lt;em>Instruments and Acoustic Measurements&lt;/em> of the Sound Engineering program at UNTREF. The &lt;strong>acoustic parameters&lt;/strong> obtained from the impulse response are essential to evaluate the behavior of an enclosure. This report presents a comprehensive characterization of the main auditorium of the &lt;strong>Usina del Arte&lt;/strong>, a cultural center in Buenos Aires. The building, originally a 20th-century power plant with a distinctive Florentine-industrial style, was transformed with an acoustic design that sought a natural and balanced quality without the need for amplification. A decoupled structure (&lt;strong>box-in-box&lt;/strong>) was implemented for isolation and interior treatment with materials such as guatambú wood, diffusive surfaces, and a suspended acoustic reflector. The objective was a reverberation time of approximately &lt;strong>2 seconds&lt;/strong> and an even distribution of early lateral reflections for an enveloping sensation.&lt;/p>
&lt;p>&lt;img src="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/vista_ext.PNG"
width="1134"
height="630"
srcset="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/vista_ext_hu376550853728715864.PNG 480w, https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/vista_ext_hu11205598148463235636.PNG 1024w"
loading="lazy"
alt="Exterior view of the Usina del Arte complex"
class="gallery-image"
data-flex-grow="180"
data-flex-basis="432px"
>&lt;/p>
&lt;h3 id="measurement">&lt;strong>Measurement&lt;/strong>
&lt;/h3>&lt;p>The characterization was carried out on June 9, 2025, during which a total of &lt;strong>162 impulse responses&lt;/strong> (monaural and binaural) were recorded. Data were captured from 27 microphone positions and 3 source positions. An on-site survey of the auditorium was also performed to analyze its constructional characteristics and a perceptual analysis was conducted.&lt;/p>
&lt;p>Prior to the measurements, a room model was created in &lt;strong>EASE 4.3&lt;/strong>, which estimated a volume of &lt;strong>15,700 m³&lt;/strong> and a Schroeder frequency of &lt;strong>22.1 Hz&lt;/strong>. Background noise was measured at eight positions to evaluate the isolation, confirming a signal-to-noise ratio greater than 40 dB. The microphone arrangement was based on the room’s symmetry to obtain a detailed mapping.&lt;/p>
&lt;p>&lt;img src="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/mapeo_puntos.PNG"
width="946"
height="876"
srcset="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/mapeo_puntos_hu16757661932159290668.PNG 480w, https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/mapeo_puntos_hu16618579752656839347.PNG 1024w"
loading="lazy"
alt="Source and microphone positions (separated according to microphone type)"
class="gallery-image"
data-flex-grow="107"
data-flex-basis="259px"
>&lt;/p>
&lt;p>More images from the measurement process:&lt;/p>
&lt;div id="carousel0" class="carousel" duration="70000">
&lt;ul>
&lt;li id="c0_slide1" style="min-width: calc(100%/1); padding-bottom: 900px;">&lt;img src="https://dibernardo.netlify.app/images/usina/med1.jpeg" alt="" />&lt;div>&lt;div>&lt;/div>&lt;/div>&lt;/li>
&lt;li id="c0_slide2" style="min-width: calc(100%/1); padding-bottom: 900px;">&lt;img src="https://dibernardo.netlify.app/images/usina/med2.jpeg" alt="" />&lt;div>&lt;div>&lt;/div>&lt;/div>&lt;/li>
&lt;li id="c0_slide3" style="min-width: calc(100%/1); padding-bottom: 900px;">&lt;img src="https://dibernardo.netlify.app/images/usina/med3.jpeg" alt="" />&lt;div>&lt;div>&lt;/div>&lt;/div>&lt;/li>
&lt;li id="c0_slide4" style="min-width: calc(100%/1); padding-bottom: 900px;">&lt;img src="https://dibernardo.netlify.app/images/usina/med4.jpeg" alt="" />&lt;div>&lt;div>&lt;/div>&lt;/div>&lt;/li>
&lt;/ul>
&lt;ol>
&lt;li>&lt;a href="#c0_slide1">&lt;/a>&lt;/li>
&lt;li>&lt;a href="#c0_slide2">&lt;/a>&lt;/li>
&lt;li>&lt;a href="#c0_slide3">&lt;/a>&lt;/li>
&lt;li>&lt;a href="#c0_slide4">&lt;/a>&lt;/li>
&lt;/ol>
&lt;div class="prev">&amp;lsaquo;&lt;/div>
&lt;div class="next">&amp;rsaquo;&lt;/div>
&lt;/div>
&lt;h3 id="processing">&lt;strong>Processing&lt;/strong>
&lt;/h3>&lt;p>Recordings were processed to obtain the impulse responses and various parameters were calculated following the &lt;strong>ISO 3382-1&lt;/strong> standard:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Reverberation time:&lt;/strong> $T_{20}$, $T_{30}$ and EDT.&lt;/li>
&lt;li>&lt;strong>Clarity:&lt;/strong> $C_{50}$ and $C_{80}$.&lt;/li>
&lt;li>&lt;strong>Strength (G):&lt;/strong> Difference in sound pressure level between the hall and an anechoic reference condition.&lt;/li>
&lt;li>&lt;strong>Lateral Fraction (LF):&lt;/strong> Proportion of sound energy perceived from the laterals.&lt;/li>
&lt;li>&lt;strong>Direct/reverberant ratio (D/R).&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Intelligibility:&lt;/strong> The &lt;strong>Speech Transmission Index (STI)&lt;/strong> and the Articulation Loss of Consonants (%Alcons) were calculated.&lt;/li>
&lt;li>&lt;strong>Stage support:&lt;/strong> $ST_{Early}$ and $ST_{Late}$, to assess acoustic conditions for musicians.&lt;/li>
&lt;/ul>
&lt;p>Various commercial software tools were used, such as the Aurora Acoustical Parameters plugin and the EASERA software, and additional parameters were computed with specific Python scripts.&lt;/p>
&lt;h3 id="results">&lt;strong>Results&lt;/strong>
&lt;/h3>&lt;p>The results show that the auditorium behaves adequately for a concert hall, but with areas for improvement:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Reverberation time:&lt;/strong> The global average was &lt;strong>1.92 s&lt;/strong>. However, notable variations were observed at low frequencies, where the floating stage acts as a resonator.&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/rtres.PNG"
width="786"
height="509"
srcset="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/rtres_hu93740916745270815.PNG 480w, https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/rtres_hu4110432717716336813.PNG 1024w"
loading="lazy"
alt="T30 and EDT results by frequency."
class="gallery-image"
data-flex-grow="154"
data-flex-basis="370px"
>&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Clarity and Intelligibility:&lt;/strong> Clarity values for speech are below recommended thresholds, and intelligibility issues were identified in certain zones.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Sound Strength (G):&lt;/strong> The sound strength level shows a low variation considering the auditorium’s dimensions.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/Gfactor.PNG"
width="776"
height="597"
srcset="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/Gfactor_hu12495539726591375420.PNG 480w, https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/Gfactor_hu210762990484597037.PNG 1024w"
loading="lazy"
alt="Mapping of the G value in space."
class="gallery-image"
data-flex-grow="129"
data-flex-basis="311px"
>&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Lateral Fraction (LF):&lt;/strong> Values exceed recommendations, suggesting that most of the sound energy comes from the laterals. This may be related to the large number of diffusers.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Background Noise:&lt;/strong> The room presents a noise level higher than recommended for a symphonic venue (NC-35 vs. NC-20), likely due to the ventilation system.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/ruido.PNG"
width="1032"
height="476"
srcset="https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/ruido_hu16139815568609075014.PNG 480w, https://dibernardo.netlify.app/p/acoustic-measurement-at-usina-del-arte/ruido_hu4680391019551906221.PNG 1024w"
loading="lazy"
alt="Background noise measurement by frequency."
class="gallery-image"
data-flex-grow="216"
data-flex-basis="520px"
>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Sound Diffusion:&lt;/strong> Repetition of a single sequence of diffusers reduces their effectiveness, producing a lobed behavior instead of stochastic diffusion.&lt;/li>
&lt;/ul>
&lt;p>Key improvements are proposed, such as reducing background noise, optimizing sound diffusion with non-periodic sequences, and balancing the spectral response by correcting low-frequency absorption.&lt;/p>
&lt;h3 id="conclusions">&lt;strong>Conclusions&lt;/strong>
&lt;/h3>&lt;p>We were able to effectively characterize the auditorium and apply most of the theoretical topics covered in class to a practical experience. The full report of this work with all results and measurement details can be found in the following &lt;a class="link" href="https://drive.google.com/file/d/1nSmWFrk30IFAhzBs9R42ZR61uK_ARc8z/view?usp=sharing" target="_blank" rel="noopener"
>report&lt;/a>.&lt;/p></description></item><item><title>Z-Plane Visualizer</title><link>https://dibernardo.netlify.app/p/z-plane-visualizer/</link><pubDate>Sat, 12 Aug 2023 00:00:00 +0000</pubDate><guid>https://dibernardo.netlify.app/p/z-plane-visualizer/</guid><description>&lt;img src="https://dibernardo.netlify.app/p/z-plane-visualizer/frontz.PNG" alt="Featured image of post Z-Plane Visualizer" />&lt;p>On the &lt;em>Procesamiento Digital de Señales&lt;/em> (Digital Signal Processing) course at UNTREF, we explore the Z-Plane for filtering design with discrete variables. During the class, the professor introduced a tool built in MATLAB that visualizes the magnitude and phase plots in relation to the positions of zeros and poles on the Z-Plane. Inspired by this, I decided to recreate this tool in Python.&lt;/p>
&lt;p>Leveraging my experience with the PyGame library, I was able to build a real-time application that allows for the movement of poles and zeros, enabling users to see how the transfer function changes in real time.&lt;/p>
&lt;h2 id="how-it-works">How It Works
&lt;/h2>&lt;p>First, I map the pixel positions on the Z-Plane to coordinates according to the unit circle representation. Then, I construct the transfer function, where each zero $z_{n}$ is a term in the numerator, and each pole $z_{i}$ is a term in the denominator. With the transfer function $H(z)$, I can plot both the magnitude and phase plots, which are also mappings from the normalized response into a space within the app.&lt;/p>
$$
H(z) = \frac{\sum_{n=0}^{N} (z - z_{n})}{\sum_{i=0}^{N} (z - z_{i})}
$$&lt;p>Each frame recalculates the transfer function. The program performs efficiently because I store the zeros and poles in arrays, enabling faster computations with the help of numpy, which is already highly optimized. This allows real-time visualizations of the changes and provides a more intuitive understanding of the behavior of the Z-Plane. The following code snippet shows how the transfer function is computed using complex exponentials:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">w&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">root&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">np&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">exp&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="n">j&lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="n">w&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="n">root&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">transfer_function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">zeros&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">poles&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">w&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">np&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">linspace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="n">np&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">pi&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">np&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">pi&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">RES&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">zero&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">zeros&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">num&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">w&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">zero&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">pole&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">poles&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">den&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">w&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">pole&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">H_z&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">num&lt;/span>&lt;span class="o">/&lt;/span>&lt;span class="n">den&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">mag&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">np&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">abs&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">H_z&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">ang&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">np&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">angle&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">H_z&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">mag&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">ang&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>This project is designed as educational material, providing students with a practical tool to better understand the interactions between poles and zeros in the Z-Plane. It is not intended as a professional filter design tool.&lt;/p>
&lt;h2 id="functionality">Functionality
&lt;/h2>&lt;p>The application has the following functionality:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Display and move poles/zeros&lt;/strong>: The user can select and choose the position of zero or pole in the Z plane. With the symmetry option active, all the poles and zeros selected or moved are attached to their symmetric par with respect to the imaginary axes.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Order&lt;/strong>: The order of the poles/zeros can be modified with the mouse wheel up to increse or down to decrease. It supports up to order 4. The color of the zero/pole change with the order.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Information&lt;/strong>: Holding the cursor over a pole or zero displays information about the position, symmetry and order.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Zoom&lt;/strong>: With the plus and minus symbols, the user can zoom in and out of the Z plane.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Delete&lt;/strong>: The trash bin symbol clears all the poles and zeros from the plane, and the user can also delete specific poles or zeros by pressing right click on them.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Magnitude Graph&lt;/strong>: The magnitude spectrum displayed in the app is normalized. This decision helps to keep the focus on the shape of the magnitude and it makes sure that the graph is visually meaningful for the user. The downside is that the difference in peak values is not captured.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Phase Graph&lt;/strong>: The phase is displayed unwrapped between $-\pi$ and $\pi$.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="demo">Demo
&lt;/h2>&lt;p>Here is a quick demo of the app in action:&lt;/p>
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
&lt;iframe src="https://player.vimeo.com/video/1045497647" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="vimeo video" webkitallowfullscreen mozallowfullscreen allowfullscreen>&lt;/iframe>
&lt;/div>
&lt;p>The source code for this project can be found on this &lt;a class="link" href="https://github.com/MatiasDiBernardo/Z-Plane_Visualizer" target="_blank" rel="noopener"
>repo&lt;/a>.&lt;/p></description></item><item><title>Time Scale Modification Algorithms</title><link>https://dibernardo.netlify.app/p/time-scale-modification-algorithms/</link><pubDate>Sat, 11 Feb 2023 00:00:00 +0000</pubDate><guid>https://dibernardo.netlify.app/p/time-scale-modification-algorithms/</guid><description>&lt;img src="https://dibernardo.netlify.app/p/time-scale-modification-algorithms/tsm.PNG" alt="Featured image of post Time Scale Modification Algorithms" />&lt;p>Time scale modifications algorithms are used to speed up or slow down the reproduction velocity of an audio. When you change the sample rate of an audio, the velocity changes but it also changes the pitch (when the audio is speed up it sounds highier pitch). There are different algorithms that change the velocity of the audio but mantain the pitch.&lt;/p>
&lt;p>The main reference for this study is the following article, where all the different algorithms are describe in detail.&lt;/p>
&lt;blockquote>
&lt;p>A Review of Time-Scale Modification of Music Signals.&lt;br>
— &lt;cite>Jonathan Driedger and Meinard Müller&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/cite>&lt;/p>
&lt;/blockquote>
&lt;h2 id="algorithm-comparison">Algorithm comparison
&lt;/h2>&lt;p>There are two main algorithms, the &lt;em>Overlap-and-add&lt;/em> (OLA) and the &lt;em>Phase Vocoder&lt;/em> (PV). Both achieve good results under different signals and conditions. For this, a final implementation using &lt;em>Harmonic Percussion Separation&lt;/em> (HPS) combines both algorithms and achiving the best results.&lt;/p>
&lt;h3 id="ola">OLA
&lt;/h3>&lt;p>This method works on time domain and overlap sections of the audio (windows) and rearange it to achive a certain desire change on speed. This method works well for percussive signals, but it introduces artifacts when used with harmonic or tonal signals.&lt;/p>
&lt;h3 id="pv">PV
&lt;/h3>&lt;p>This method works on frequency domain, and it combines chunks of audio in the frequency domain to achieve the desire change in time. This uses the phase vocoder principle to propagate the phase between the windows, this grantice the continuity of when applied to harmonic signals. On the contrary, it does not work for percussive signals becouse the phase propagation process eliminate the transients in the signals.&lt;/p>
&lt;p>I created visualizations using &lt;em>Manim&lt;/em> to enhance my class presentation. The first video demonstrates how the PV algorithm aligns windows to ensure smooth transitions in the generated signal over time. To achieve this, a Gaussian window is applied, which maintains continuity and smoothness, even at the start and end of the sequence.&lt;/p>
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
&lt;iframe src="https://player.vimeo.com/video/1045495557" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="vimeo video" webkitallowfullscreen mozallowfullscreen allowfullscreen>&lt;/iframe>
&lt;/div>
&lt;p>The second video showcases the effects of applying the PV algorithm to a signal containing transients.&lt;/p>
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
&lt;iframe src="https://player.vimeo.com/video/1045495634" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="vimeo video" webkitallowfullscreen mozallowfullscreen allowfullscreen>&lt;/iframe>
&lt;/div>
&lt;p>As predicted by theory, the transients vanish because the PV algorithm disrupts the vertical phase alignment. While these examples utilize idealized signals, they effectively demonstrate the key strengths and limitations of the algorithm.&lt;/p>
&lt;h3 id="hps">HPS
&lt;/h3>&lt;p>To use both methods with their ideal signals, the HPS algorithms is used. This algorithm separete the signal into the harmonics and the percussive parts. It works by comparing the continuty of the signal in the STFT representation and using a filter to compare vertical versus horizontal presence on the spectrogram. With a threshold, a binary mask can be define over the spectrogram to separete the percussive parts from the harmoincs sections.&lt;/p>
&lt;h2 id="results">Results
&lt;/h2>&lt;p>We succesfully implement all the algorithms and compare them, verifying the theortical contents presented on the referenca article. In the process, we develope the toolkit to use this algorithms with the python programming language. All the code is avaliable on this &lt;a class="link" href="https://github.com/MatiasDiBernardo/TSM_Toolkit" target="_blank" rel="noopener"
>repo&lt;/a>&lt;/p>
&lt;h2 id="academic-presentation">Academic Presentation
&lt;/h2>&lt;p>The study was preseented with my classmates on the &lt;em>JAAS&lt;/em> (Jornadas de Acustica, Audio y Sonido). The main ideas and conclusions were preseneted on the conference. In the following repoert there is all the details and anlysis done for this proyect (in spanish).&lt;/p>
&lt;blockquote>
&lt;p>ALGORITMOS DE MODIFICACIÓN DE ESCALA TEMPORAL.&lt;br>
— &lt;cite>Matías Di Bernardo; Matías Vereertbruhggen; Sebastían Carro &lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup>&lt;/cite>&lt;/p>
&lt;/blockquote>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>A Review of Time-Scale Modification of Music Signal &lt;a class="link" href="https://www.researchgate.net/publication/295082364_A_Review_of_Time-Scale_Modification_of_Music_Signals" target="_blank" rel="noopener"
>paper&lt;/a>.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;li id="fn:2">
&lt;p>JAAS 2023 - Algoritmos de Modificación de Escala Temporal &lt;a class="link" href="https://drive.google.com/file/d/12kPB3qBjczyx7X2XV3ZpBDo1GDO2u4qR/view?usp=sharing" target="_blank" rel="noopener"
>paper&lt;/a>.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Comparative analysis of time-frequency transformations</title><link>https://dibernardo.netlify.app/p/comparative-analysis-of-time-frequency-transformations/</link><pubDate>Fri, 11 Nov 2022 00:00:00 +0000</pubDate><guid>https://dibernardo.netlify.app/p/comparative-analysis-of-time-frequency-transformations/</guid><description>&lt;img src="https://dibernardo.netlify.app/p/comparative-analysis-of-time-frequency-transformations/fourier.jpg" alt="Featured image of post Comparative analysis of time-frequency transformations" />&lt;p>This research is conducted as part of the subject &lt;em>Metodología de la Investigación&lt;/em> at UNTREF. The article aims to compare the differences between three types of time-frequency transformations:&lt;/p>
&lt;ol>
&lt;li>Fourier Transform (FT)&lt;/li>
&lt;li>Wavelet Transform (WT)&lt;/li>
&lt;li>Huang-Hilbert Transform (HHT)&lt;/li>
&lt;/ol>
&lt;p>The objective of this work is to understand the differences between these types of transformations and deepen my knowledge of signal processing.&lt;/p>
&lt;h2 id="objective">Objective
&lt;/h2>&lt;p>The general objective of the research is to determine which spectral analysis tool achieves the highest accuracy in pitch detection tasks.&lt;/p>
&lt;p>To achieve this objective, the following specific objectives are proposed:&lt;/p>
&lt;ul>
&lt;li>Identify the parameters needed to represent the signal in the spectral domain for each case.&lt;/li>
&lt;li>Select an algorithm that identifies the pitch of the signal based on its spectral representation.&lt;/li>
&lt;li>Generate the data (audio signals) to be used for the comparison.&lt;/li>
&lt;li>Evaluate the generated data with the different analysis methods and apply statistical processes to validate the results.&lt;/li>
&lt;li>Establish a measure of accuracy for the pitch detection task.&lt;/li>
&lt;li>Compare the results of the different analyses and determine which method achieves the highest accuracy in pitch detection.&lt;/li>
&lt;/ul>
&lt;p>The pitch detection task was chosen because it is one of the main applications of these types of transformations.&lt;/p>
&lt;h2 id="algorithms">Algorithms
&lt;/h2>&lt;p>The theoretical analysis of all the transformations is performed in the continuous domain, but to conduct the experiments and comparisons, the discrete domain is used, enabling all calculations to be performed digitally.&lt;/p>
&lt;h3 id="fft">FFT
&lt;/h3>&lt;p>The FFT is an algorithm that optimizes the DFT (Discrete Fourier Transform). With this algorithm, the spectral representation of the signal is obtained according to Fourier analysis, which decomposes a complex signal into a sum of sines or cosines. The DFT is calculated using the formula:&lt;/p>
$$
X_k = \sum_{n=0}^{N-1} e^{-i\frac{2\pi}{N}kn} x_n
$$&lt;p>Where \( N \) is the number of signal samples, and \( k \) are natural numbers from \( 0 \) to \( N – 1 \).&lt;/p>
&lt;h3 id="wt">WT
&lt;/h3>&lt;p>The Wavelet Transform (WT) uses an oscillatory function (wavelet) and applies a convolution between the signal and the chosen wavelet function to determine whether that wave shape is present in the signal. The wavelet is stretched and scaled in frequency and amplitude, allowing a single wavelet function to recreate the entire spectrum of interest.&lt;/p>
&lt;p>In this research, the CDWT (Cyclic Discrete Wavelet Transform) will be used, the most common implementation when discretizing the WT. Conceptually, this transform extends Fourier analysis by projecting the signal onto a basis of wavelet functions instead of sines and cosines. It is calculated as follows:&lt;/p>
$$
Wf[n, a^j] = \sum_{m=0}^{N-1} f[m] \psi_j[m-n]
$$&lt;p>Where \( N \) is the number of signal samples, \( \psi \) is the wavelet function, and \( j \) represents the deformation of the wavelet according to the selected wavelet bank.&lt;/p>
&lt;h3 id="hht">HHT
&lt;/h3>&lt;p>Lastly, the Huang-Hilbert Transform (HHT) will be used for spectral representation. It employs a method called Empirical Mode Decomposition (EMD) to decompose the signal into subsignals that contain the relevant information of the original function.&lt;/p>
&lt;p>Like the previous analysis methods, the key part of the analysis is the decomposition of the signal into simpler signals. However, instead of sine or wavelet functions, EMD finds intrinsic mode functions (IMFs) that form the basis of our decomposition and are unique to each signal.&lt;/p>
&lt;p>The relationship between the IMFs and the frequency of the original signal is established with the equation:&lt;/p>
$$
z(t) = f(t) + i H\{ f(t) \}
$$&lt;p>Where \( f(t) \) is an IMF of the original signal, and \( H \) is the Hilbert Transform. This allows the IMF to be represented as a complex signal by projecting it onto the imaginary axis using the Hilbert Transform.&lt;/p>
&lt;p>Thus, the IMF is represented as a complex signal, and the amplitude and phase of each moment can be extracted to construct the spectral representation. Since a signal generally has multiple IMFs, this process is repeated for all of them, and the results are summed to obtain the complete spectrum.&lt;/p>
&lt;h2 id="procedure">Procedure
&lt;/h2>&lt;p>This research analyzes the relationship between types of spectral representation and accuracy in pitch detection.&lt;/p>
&lt;p>First, the parameters for the different transformations will be selected. Among the most critical parameters to determine is the number of samples for temporal windowing, as it determines the trade-off between temporal and frequency resolution.&lt;/p>
&lt;p>To ensure a fair comparison among the methods, data representing various cases of interest will be generated, including four types of signals:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Monophonic&lt;/strong>: Signals with a single note corresponding to \( F_0 \).&lt;/li>
&lt;li>&lt;strong>Polyphonic&lt;/strong>: Signals with multiple notes where harmony determines \( F_0 \).&lt;/li>
&lt;li>&lt;strong>Slow Transitions&lt;/strong>: Signals with gradual changes in \( F_0 \).&lt;/li>
&lt;li>&lt;strong>Fast Transitions&lt;/strong>: Signals with abrupt changes in \( F_0 \).&lt;/li>
&lt;/ul>
&lt;p>The real value \( V(t) \) will be compared to the result \( P(t) \) from each transform, integrating the difference over time to calculate the accuracy.&lt;/p>
&lt;h2 id="results">Results
&lt;/h2>&lt;p>At this stage, the task was to complete the research plan detailing the procedure and analysis methods. Dummy data was generated and statistically validated to simulate expected results.&lt;/p>
&lt;p>&lt;img src="https://dibernardo.netlify.app/p/comparative-analysis-of-time-frequency-transformations/res.PNG"
width="834"
height="550"
srcset="https://dibernardo.netlify.app/p/comparative-analysis-of-time-frequency-transformations/res_hu8387233291062647437.PNG 480w, https://dibernardo.netlify.app/p/comparative-analysis-of-time-frequency-transformations/res_hu2809804783985204141.PNG 1024w"
loading="lazy"
alt="Graph showing the precision of each transform according to the type of signal analyzed"
class="gallery-image"
data-flex-grow="151"
data-flex-basis="363px"
>&lt;/p>
&lt;p>The graph compares the precision achieved by the three transformations for different signal types. Based on the properties of the transforms, the Wavelet Transform (WT) is expected to outperform the Fourier Transform (FT), and the Huang-Hilbert Transform (HHT) is expected to achieve the highest precision overall.&lt;/p>
&lt;h2 id="conclusions">Conclusions
&lt;/h2>&lt;p>In pitch detection tasks using spectral analysis, the Huang-Hilbert Transform (HHT) generally provides higher precision than the Fast Fourier Transform (FFT) and the Cyclic Discrete Wavelet Transform (CDWT).&lt;/p>
&lt;p>The significance of this precision gain depends on the type of signal being analyzed, with fast-transition signals benefiting the least from the transformation change, while polyphonic signals show the most significant improvement when using the HHT.&lt;/p>
&lt;p>This project allowed me to deepen my understanding of signal processing and grasp the foundations of why tools like the WT and HHT are used based on the characteristics of the signal being analyzed.&lt;/p>
&lt;p>All details of this work are available in the following &lt;a class="link" href="https://drive.google.com/file/d/1G5kasP3BzZPVuxrXArHM72pUVlkN9b2Q/view?usp=sharing" target="_blank" rel="noopener"
>report&lt;/a>.&lt;/p></description></item></channel></rss>