can i use Wavelet transform to extract frequency of voltage and current signals?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to extract coefficients of voltage and current signals to give inputs to my Neural Network.or is there anyeasy way to extract the frequency components?i tried this code though:
numcsvfiles = 2; % Number of csv files
a4_matrix_Concatenated = [];
for z = 1:numcsvfiles
filename= strcat(int2str(z),'.csv'); % Suppose the csv files are named: 1.csv, 2.csv, ...
name = strcat('a4_matrix_csv',int2str(z),'.mat');
clear a4_matrix
for k = 1:6
display(['CSV file number ' num2str(z) ' , Column number ' num2str(k)])
% Read the z-th csf file
aux_var = csv(:,(k));
%figure(1);
%plot(aux_var);
N=4;
% Calculate the wavelet decomposition
[C,L] = wavedec(aux_var,N,'db1'); % Daubechies 1 Wavelet
%tam_a4=L(1);
%a4 = C(1:tam_a4,1);
%cA4 = appcoef(C,L,'db1',4);
% Reconstruct the level 4 approximation from the wavelet
A4 = wrcoef('a',C,L,'db1',N);
a4_matrix(:,k)=A4;
%figure(2);
%plot(A4);
end
a4_matrix_Concatenated = [a4_matrix_Concatenated;a4_matrix];
% save(name,'a4_matrix'); % Save the matrix with a4 coefficients to each csv file
end
save('a4_matrix_Concatenated.mat','a4_matrix_Concatenated')
%%Test plot
% 2.csv - current_3 - graph and a4 graph
figure(1);
plot(aux_var);
figure(2);
plot(A4);
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Filter Banks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!