1-D signal to 2D feature map

9 vues (au cours des 30 derniers jours)
Bahadir
Bahadir le 8 Oct 2025
Commenté : Bahadir le 13 Oct 2025
Dear Sir,
I have 1000 points Ia,Ib and Ic dataset. I attached data.mat
ı want to segmentation and reconsruction like the picture.
Every segment has 300 point, overlapping 75 points
is my code true?
load("data.mat");
Ia=data(:,1);
Ib=data(:,2);
Ic=data(:,3);
L = 300; % Seqmentation
O = 75; % overlap
S = L - O; % Slide step
numSegments = floor((length(Ia)-L)/S) + 1;
featureMaps = cell(numSegments,1);
for k = 1:numSegments
idxStart = (k-1)*S + 1;
idxEnd = idxStart + L - 1;
% Segmentleri al
segIa = Ia(idxStart:idxEnd);
segIb = Ib(idxStart:idxEnd);
segIc = Ic(idxStart:idxEnd);
% Üç fazı dikey olarak birleştir (300x3)
segmentData = [segIa(:), segIb(:), segIc(:)];
% Reshape to 900x1
flatData = reshape(segmentData, [900, 1]);
% Reshape to 30x30 feature map
featureMap = reshape(flatData, [30, 30]);
featureMaps{k} = featureMap;
end
% visualization
figure;
imagesc(featureMaps{1});
colormap('jet');
colorbar;
title('2-D Feature Map (Segment 1)');
xlabel('Columns');
ylabel('Rows');
  2 commentaires
Chuguang Pan
Chuguang Pan le 9 Oct 2025
@Bahadir.It seems that your code is correect. By the way, you can also use buffer function to segment signal for more succinct code.
Bahadir
Bahadir le 13 Oct 2025
@Chuguang Pan Thank you so much

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Large Files and Big Data dans Help Center et File Exchange

Tags

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by