Wavelet expansions, function spaces and multifractal analysis