# Reconstructing the song using its dominant frequencies

I have found out 20 dominant frequencies of a song by splitting it into 20 sound-clips and applying Fourier transform on each one of the sound-clips. Now I am trying to reconstruct the song back from these 20 dominant frequencies.

info_ = audioinfo('../wws.wav'); % 11 secs long song

Fs = info_.SampleRate;
chunkDuration = 0.6;
numSamplesPerChunk = chunkDuration*Fs;

freq_vec = [];
for startLoc = 1:numSamplesPerChunk:info_.TotalSamples
endLoc = min(startLoc + numSamplesPerChunk - 1, info_.TotalSamples);
[x, Fs] = audioread('../wws.wav', [startLoc endLoc]);
x = x(:,1);
dt = 1/Fs;
t = 0:dt:(length(x)*dt)-dt; % time scale
L = length(t);
nfft = 2^nextpow2(L);
y = fft(x, nfft);
y = abs(y.^2);
y = y(1:1+nfft/2);
[v,k] = max(y);
f_scale = (0:nfft/2)* Fs/nfft;
freq_vec = [freq_vec, f_scale(k)];
end


freq_vec is the vector of dominant frequencies of the song. My question is how can I use these frequencies to build back the song.

• How did you get the idea that you can reconstruct the song from those frequencies? In your code you throw away tons of information, so I don't understand how you can expect to be able to reconstruct anything. Commented Jan 3, 2018 at 11:18
• @MattL. I was a bit hesitant at first, but in the end: questions of this type come up so often, we might even answer one. And the answer is what you say in your comment: If you irrevocably throw away information, its lost, and can't be recovered. Commented Jan 3, 2018 at 11:49