MATLAB: Plot multiple PSD lines in single graph in color scale (imagesc)

psd; welch; pseudocolor; imagesc;

Hi, I have 13 signals where I produce the PSD for each with the psd function using Welch's method object (spectrum.welch). But this only allows me to generate separate plots for each signal. Is there a way to express all 13 PSDs in pseudocolor (like imagesc) in a single figure where Y is each of the 13 signals, X is the frequencies, and the color is the power/frequency (dB/Hz)? So basically I want to generate a 13 x n matrix containing the PSD of each signal.
Example:
Fs=10000; %sampling frequency in samples per second
t=0:(1/Fs):1; %one second time vector, 10001 elements
y=0.4*cos(2*pi*2000*t)+0.2*sin(2*pi*1000*t)+randn(size(t));
h = spectrum.welch;
Hpsd=psd(h,y,'Fs',Fs,'ConfLevel',0.95);
figure, plot(Hpsd)
This only gives me 1 plot. If I do this 13 times, how can I create a 13 x n figure where the PSDs are expressed in color? I basically want a figure that looks like imagesc(rand(13,100)) but with PSDs and not random numbers.
Thanks in advance!

Best Answer

Yes you can generate the 2D spectrum, here is an example with 13 signals as you said :
Fs=80;
f=10+rand(13,1)*10; % frequencies of the signals
t=0:1/Fs:10-1/Fs;
y=zeros(13,length(t));
for n=1:13
y(n,:)=sin(2*pi*t*f(n));
end
% spectrum
h=spectrum.welch;
F=zeros(13,129);
for n=1:13
t=psd(h,y(n,:),'Fs',Fs);
F(n,:)=t.Data;
end
figure, surface(F), shading interp
You add the x,y labels...