1
votes

I'm having some trouble to understand the output of the FFT of a piano note (A1, f=55 Hz).

I was expecting to get a "strong" frequency at 55 Hz, but instead I'm getting a "strong" frequency at 220 Hz, which correspond to a A3, two octaves up.

This is the code I'm using:

[audio,fs] = audioread('a1.wav');
audio      = audio(:,1)./max(audio(:,1));
dt         = 1/fs;
t          = linspace(0, length(audio)/fs, length(audio));
T          = max(t);
fftAudio   = fftshift(fft(audio));
mfft       = abs(fftAudio);
pfft       = angle(fftAudio)*(180/pi);
f          = linspace(-fs/2,fs/2,length(fftAudio));
%%
figure,plot(f,mfft,'m.-'),grid on
xlim([0 fs/2])

Either I'm doing something wrong of somehow MATLAB "ignores" the low frequencies. There's the FFT: enter image description here

This is zoom in FFT:

FFT

Does anyone know why this is happening? Thank you.

1
The plot command doesn't correspond to the figure you're showing. Please show how you plot mfft.Cris Luengo
@CrisLuengo done.user4061624
are you sure your data is right? Everything looks fine. You frequency bins a shift a little but no big deal. Should be f = -fs/2:fs/Nfft:fs/2-fs/Nfft;TwistedSim
What is the sampling frequency? maybe audioread give you the wrong one.TwistedSim
@TwistedSim fs = 16000 Hz. Why?user4061624

1 Answers

0
votes

You have merely discovered that some pianos produces sets of strong harmonic overtones with occasionally weak fundamental frequency spectrum (effects that might possibly be caused by string diameter and stiffness, soundboard resonance energy swaps, or microphone response and placement).

Some reading on the physics of musical instruments, and the psychoacoustics of human hearing might help.