Convert Signal into a image for deep CNN input
Show older comments
Hi,
I'm doing a work on creating a deep CNN network that has a multi input of images. In particoular electrograms in time domain, sswt, hht, cwt.
How can i convert a 500x1 signal into a 100x100 matrix that will become an image with significant info input for the CNN?
I thought something like this
M=zeros(100,100);
y=floor(mean(reshape(sig,[5 100]))); %returns the mean of 5 elements along the vector of the signal
for i=1:size(M,1)
for j=1:size(M,2)
M(i,j)=y(i);
end
end
figure
image(M)

f=getframe;
p=f.cdata;
I=imresize(p,[100 100]);
imwrite(I,'filename.jpeg')
%ready to be saved
%or in a easier way, but i don't know if this will have useful info for the
%CNN
plot(M)
f=getframe;
p=f.cdata;
I=imresize(p,[100 100]);
imwrite(I,'filename.jpeg')

These are not the saved images, all of the parameters of them, like colormap, caxis and etc will be tweaked later.
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on AI for Signals 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!



