function [specData,F,T,parameter] = filename_to_spectrogram(wavfile,parameter);


[f_audio,sideinfo_audio] = wav_to_audio('', parameter.DirWAV, wavfile );
parameter.fs = sideinfo_audio.wav.fs;



[specData, featureRate, F, T] = audio_to_spectrogram(f_audio,parameter);
parameter.featureRate = featureRate;
f_idx = F<parameter.F_max;
specData = specData(f_idx,:);
F = F(f_idx);



if parameter.logCompression 
        specData = log(1+ parameter.logCompression .*specData./max(max(specData)));
end

if parameter.visualize
    figure; imagesc(T, F, specData); colormap(hot); colorbar; axis xy;
    title('Original Spectrogram'); xlabel('Time (sec)'); ylabel('F')
end