Customize variables of spectogram
7 views (last 30 days)
I am trying to create the spectogram with the respective variables. I understand that spectral functions only give back the variable of frequency and time. I guess I have to use imagec to customize my spectogram. However, I am unable to replicate the variables. Might need some help and guidance. My x-axis would be distance instead of time, while the y-axis is wavelength and the c-axis is dB(PSD).
This is my current output while my ideal output is the one below.
As attached is my code
rows = numel(dist);
sampdist = abs ((dist(rows) - dist(1)))/(rows-1);
totallength = dist(rows) -dist(1);
ylabel ('Roughness (um)');
xlabel ('Distance (m)');
window = hamming(512);
noverlap=256; %number of overlaps
nfft=1024; %size of the fft
fs_samp=1/sampdist; %i have my sampling frequency
roughamplitude = rough - mean(rough); %focus on fluctuation
Kshitij Chhabra on 4 Aug 2021
From my understanding of the question, you want to modify the x, y, and z labels of the figure in the first image so that it looks like the one in the second image.
To achieve the same, you can modify the XLabel, YLabel and the ZLabel properties of the figure axes as follows:
For further information about the axes properties you can check here.