Using different algorithms/formulas to create spectrograms
so here's a short MATLAB script that will compute and draw a spectrogram.

if ~exist('inputFile', 'var')
    inputFile = 'tom_hit.wav';
end

if ~exist('frameLength', 'var')
    frameLength = 8192;
end
frameLength = 2.^(ceil(log2(frameLength) - 1e-10));

if ~exist('frameHop', 'var')
    frameHop = 256;
end
frameHop = 2.^(floor(log2(frameHop) + 1e-10));
frameHop = min(frameHop, frameLength/2);                                    % insure at least 50% overlap


[inputBuffer, Fs] = audioread(inputFile);

[inputFileSize, nChannels] = size(inputBuffer);

nSamples = 2.^(ceil(log2(inputFileSize + frameLength) - 1e-10));            % zero-pad on both sides and round up to nearest power of 2

nFrames = floor((nSamples-frameLength)/frameHop);

x = zeros(nSamples, 1);
x(frameLength/2+1:frameLength/2+inputFileSize) = inputBuffer(:,1);          % use left channel only, zero-pad half frame on both sides

clear inputBuffer;                                                          % free this memory

dB_floor = -90;

beta = 5;
frameWindow = gausswin(frameLength, beta);                                  % gaussian window

XX = zeros(nFrames, frameLength/2+1);

for frame = 1:nFrames

    X = fft( fftshift( x((frame-1)*frameHop+1:(frame-1)*frameHop+frameLength, 1).*frameWindow ) );

    XX(frame,:) = abs( X(1:frameLength/2+1) ).^2 + 10^(dB_floor/10);        % leave XX as energy with dB_floor dB floor.

end

figure(1);
[taxis, faxis] = meshgrid(0:Fs/frameLength:Fs/2, 0:frameHop/Fs:(nFrames-1)*frameHop/Fs);
surf(faxis, taxis, 10*log10(XX), 'EdgeColor','none', 'LineStyle','none');
xlabel('sec')
ylabel('Hz')
zlabel('dB')
view(40,40);