Buzzing sound while recording sound with the library TMRpcm

Greetings,

I am trying to record my voice using the TMRpcb library and save my recordings in a sd card. Before someone says you cannot record your voice in Arduino and play it back, please check the link I have submitted https://www.instructables.com/id/Make-Your-Own-Spy-Bug-Arduino-Voice-Recorder/.

I am using an Arduino Uno, micro sd card class 10 format: fat32 and the Sparkfun, BOB-12758.
I have modify the file pcmConfig.h
If someone has encounter my problem and is eager to help me I will be grateful.

Because Fritzing is always freeing in my pc. My connections are:
Microphone, Vcc -> VccArduino; Gnd -> GndArduino; Signal -> A0.
SD MODULE, Vcc -> VccArduino; Gnd -> GndArduino; CS -> 4; SCL -> 13; MOSI -> 11; MISO -> 12

(I have tried different buffer sizes, eg 32,64,128 & 254. But I still get an annoying voice from behind)

Thank you in advance

Recording_1.ino (2.16 KB)

pcmConfig.h (4.02 KB)

But I still get an annoying voice from behind)

What do you mean by that? It it a buzz like the title says or is it a voice?

It could be that the analogue input is too large or not biased correctly.

Please note that instrcutables are generally crap and the link you provided said the quality was not the best. Also Fritzing is crap so you have no great losss there but we still need a schematic, Hand draw is just fine.

I can hear my voice, but over my voice I hear a buzzing sound. I know the instrcutables is not the best site to acquire knowledge. Moreover, I know I must add an LPF (Butterworth ) with Fc = 4kHz to decrease the overall noise. But when I add the LPF in the matlab still I got this annoying voice.

I have upload my schematic, is on paint and I apologize for this "quality" of my schematic.
In the zip file I have attach a small .wav file

TESTA0_64.zip (70.5 KB)

I can hear my voice, but over my voice I hear a buzzing sound

When you don't speak is there still a buzzing noise?

I add the LPF in the matlab still I got this annoying voice.

What sample rate is this running at? You need to filter out any signals lower than half the sample rate from the input to matlab to stop aliasing which itself will sound very bad.

Use the FFT feature of matlab in order to look at the spectrum of the output to see if you can identify frequencies associated with this noise.

I hear the buzzing, I am not speaking. My sample rate is at 16kHz.
I attach a photo of my signal using FFT

(code in matlab, for the FFT, Fast Fourier transform - MATLAB fft)
clc
clear
[dataIn,Fs] = audioread('TESTA0_64.WAV');
T = 1/Fs; % Sampling period
L = length(dataIn); % Length of signal
t = (0:L-1)*T; % Time vector
Y = fft(dataIn);

P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2P1(2:end-1);
f = Fs
(0:(L/2))/L;
plot(f,P1)
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')

fft.png

Interesting, can you expand the low frequency end, but it looks like it is mains hum. Maybe due to the noise on the power supply.

Yes, I notice it that now. The funny part is, I power the arduino by usb port of my laptop (I don't have plug the battery of my laptop).
I will try, to record my voice while my laptop is power by the battery.

Fourier.jpg

Fourier_powered_by_battery_solely.jpg

If that graph scale is accurate its about 33Hz, stable frequency with loads of harmonics so clearly a
fairly square/rectangular signal.

My hunch is it will be clearly visible on a 'scope AC-coupled to the 5V USB supply.

Anyway I'd never expect a computer's USB power would be anything like clean enough for audio
circuitry to use without heavy filtering.