How can I extract the frequencies of details and approximation of a signal that decomposed by "wavedec" command?

5 ビュー (過去 30 日間)
%% This commands used for extracting details and approximations ;
%% I want to Know haw can I earn frequencies of each detail and approximation????
clc
clear
close all
a=signal;
Fs=5e6;
dt=1/Fs;
wname='db10';
nLevel=4;
[C, L]=wavedec(a,nLevel,wname);
A4 = appcoef(C,L,'db10',4);
[D1,D2,D3,D4] = detcoef(C,L,[1,2,3,4]);

回答 (1 件)

Suraj Kumar
Suraj Kumar 2024 年 8 月 30 日
Hi Esmail,
1. To extract the frequencies of details and approximation of a signal that was decomposed by ‘wavedec command, you can define the wavelet decomposition parameters and perform the decomposition of the signal into detailed coefficients.
wname = 'db10';
nLevel = 4;
[C, L] = wavedec(a, nLevel, wname);
A4 = appcoef(C, L, wname, 4);
[D1, D2, D3, D4] = detcoef(C, L, [1, 2, 3, 4]);
2.Then you can determine the frequency ranges for each detail and approximation level based on the Nyquist frequency and decomposition level.
for i = 1:nLevel
f_high = Fs / (2^(i-1)); % Upper frequency of the detail
f_low = Fs / (2^i); % Lower frequency of the detail
fprintf('Detail D%d: %.2f Hz to %.2f Hz\n', i, f_low, f_high);
end
f_approx = Fs / (2^nLevel);
fprintf('Approximation A%d: 0 Hz to %.2f Hz\n', nLevel, f_approx);
You can refer to the output below for better understanding:
To know more about ‘wavedec,appcoef or ‘detcoef functions in MATLAB, you can refer the following documentations:
Hope this works for you!

カテゴリ

Help Center および File ExchangeDiscrete Multiresolution Analysis についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by