Fourier Series: Music from a Piano vs Keyboard

1k Views Asked by At

So, I've been working on a project to compare the Fourier Series of a Piano versus that of a Keyboard. I've computed the FFT on MATLAB using this code:

dt = 1/fs

t = (1:length(data))*dt

X=fft(data)

df=1/(length(data)*dt)

f=(1:length(X))*df

figure

plot(f,abs(X))

I plotted the FFT, and this is what I got:FFT OF A PIANO

Now, when I clicked GENERATE CODE, this is what I got:

function createfigure(X1, YMatrix1)

%CREATEFIGURE(X1, YMATRIX1)

% X1: vector of x data

% YMATRIX1: matrix of y data

% Auto-generated by MATLAB on 31-Aug-2016 19:32:43

% Create figure

figure1 = figure;

% Create axes

axes1 = axes('Parent',figure1);

hold(axes1,'on');

% Create multiple lines using matrix input to plot

plot(X1,YMatrix1);

box(axes1,'on');

NOW, My question is, how do I come up with the Fourier Series for this FFT? What I mean is, how do I include the Integration, Matrices, etc, essentially the mathematics behind this in my research paper? I can't just upload this graph, can I. I would appreciate it if somebody could explain how to do it and also support it with an example.

THANKS IN ADVANCE :-)