Is there any algorithm to decompose a wave into a set of given frequencies?
You could use the Goertzel algorithm to compute the discrete Fourier transformation for just the frequencies you want to detect.

The Goertzel algorithm is used to detect single bins from the DFT.  You implement a bunch of them, each set to one of your desired frequencies, and calculate them for each audio sample.  

Anything that doesn't fit your selected bins is ignored.  If you implemented it for the frequencies given in your example (5Hz, 14Hz, 37Hz, 42Hz, and 59Hz) but your audio was a sine wave at 100Hz, then your software could not detect that 100Hz signal.

The Goertzel algirithm can be "tuned" to make the bins narrower.  You would probably need to do that to separate the frequencies given in your example.  They are very close together, so you would need to use very large $N$ to calculate the coefficients for each bin.  This has the side effect of making the algorithm respond slowly - quickly changing frequencies would not be detected properly.