Is there a way to show gain has been added to a signal?

4 visualizaciones (últimos 30 días)
Moasis3141
Moasis3141 el 27 de En. de 2018
Comentada: Star Strider el 28 de En. de 2018
I have an audio file that produces a 13230080x2 matrix. The first column represents the raw data, the second column represents the same data with 6dB of gain. Am I able to graphically show that gain has been added to that signal?

Respuesta aceptada

Star Strider
Star Strider el 27 de En. de 2018
I would take the fft (link) of both, express them both as decibels (using 20*log10(abs(x)) where ‘x’ is each signal) and then plot them together (using the hold function).
You should be able to see the gain.
  4 comentarios
Moasis3141
Moasis3141 el 28 de En. de 2018
%%Representing gain
%Extracting gained and ungained columns
y_ungained = y_air_raw(:,1);
y_gained = y_air_raw(:,2);
%Performing fft on both
fft_gained = fft(y_gained);
fft_ungained = fft(y_ungained);
%Transforming each signal to decibels
deci_gained = 20*log10(abs(fft_gained));
deci_ungained = 20*log10(abs(fft_ungained));
%Plotting each signal
figure(1)
plot(deci_gained)
hold on
plot(deci_ungained)
%Finding the difference
diff = deci_gained - deci_ungained;
figure(2)
plot(diff)
This is what my code looks like currently
Star Strider
Star Strider el 28 de En. de 2018
My guess is that your signals are simply very noisy, and the noise is obscuring the details. If you take the mean of your ‘diff’ variable, you will quite likely see the difference, because ‘diff’ does not appear to be symmetric about 0, instead having a positive bias.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by