convert time domain data to frequency domain
Afficher commentaires plus anciens
Dear all,
I want to convert this data (time-domain) to frequency domain using plomb and fft. The structure of data I have like this:
Col 1: Year, Col 2: Month, Col 3: Date, Col 4: Hours, Col 5: Data
The interval between data is 1 hour, even though there are missing data. How can I convert it to frequency domain using plomb or fft?
Thank you!
1 commentaire
Adib Muhammad
le 29 Oct 2024
Réponse acceptée
Plus de réponses (1)
Jaimin
le 29 Oct 2024
Begin by creating a complete time series with your data, ensuring any missing hours are filled in. You can use the “interp1” function to fill in the missing values.
You can utilise “fft” function to convert data to frequency domain.
To utilize “plomb” in MATLAB, you might consider a custom implementation, as MATLAB doesn't have a built-in function specifically for “plomb”. However, you can use functions like “pburg” or similar methods to estimate the power spectrum of unevenly sampled data.
Kindly refer following Code Snippet to understand.
% Perform FFT
N = length(full_data_vector);
Y = fft(full_data_vector);
% Using pburg for estimating the power spectrum
p = 10; % Order of the autoregressive model
[pxx, f] = pburg(full_data_vector, p, length(full_data_vector), 1); % 1 Hz sampling rate
Kindly refer following MathWorks Documentations to understand more on
I hope this will be helpful.
1 commentaire
Adib Muhammad
le 30 Oct 2024
Catégories
En savoir plus sur Filter Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







