I finished a code for my own spectrogram. Really short. Can someone tell me if this is outputting right?

1 view (last 30 days)
So I wrote my own code for a spectrogram. I used just random (x,z,t) data points since I don't have the actual data yet. I don't get any errors and I get a plot, but is this still outputting a frequency vs. time plot? I'm not sure i should be using matrices instead of vectors for the x,z, and t data.
x = rand(5);
z= rand(5);
t=rand(5);
[a b] = size(x);
G=gaussmf(t,[2 5]);
ind = a*b;
i=1;
if i<= ind;
x(i)= abs(fftc(x(i)*G(i))).^2;
z(i)=abs(fftc(z(i)*G(i))).^2;
i=i+1;
end
surf(t,x,z)
any help would be great!

Answers (0)

Categories

Find more on Time-Frequency Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!