Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

Asked by Matthew on 30 Jan 2013

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!

0 Comments

Matthew

Products

No products are associated with this question.

0 Answers

Contact us