SNR of a signal

2 ビュー (過去 30 日間)
shazmina jamil
shazmina jamil 2019 年 2 月 19 日
回答済み: AR 2025 年 3 月 26 日
I want to calculate SNR of a plot signal which is actually phase of the current given by PMU. my data is in excel file having 36001 rows(samples) i want to calculate SNR but by applying differnt conditions and checking these conditions for only 10 samples . How can I do this so that i get my output after every 10 samples?

回答 (1 件)

AR
AR 2025 年 3 月 26 日
It is my understanding that you want to calculate the SNR in sets of 10 samples and receive the output after processing each batch for phase data stored in an Excel file with 36,001 samples.
You can do this by following the below steps:
1. Load the excel file using “xlsread” and extract the phase values (assuming they are in the first column).
data = xlsread('phase_data.xlsx'); % Load the file
phase_signal = data(:,1); % Extract phase values
2. Define batch size as 10 to process data in segments of 10 samples and initialize an empty array to store these SNR values.
num_samples = length(phase_signal);
window_size = 10; % Process every 10 samples
snr_values = []; % Store SNR values for each window
3. Process data in segments of 10.
for i = 1:window_size:num_samples-window_size+1
signal_chunk = phase_signal(i:i+window_size-1); % Extract 10 samples
4. Depending on your requirement, define the noise and signal conditions.
5. Compute SNR in dB.
SNR_dB = 10 * log10(signal_power / noise_power);
6. Store results
snr_values = [snr_values; SNR_dB];
% Display output after every 10 samples
fprintf('SNR for samples %d to %d: %.2f dB\n', i, i+window_size-1, SNR_dB);
end % end for loop
For reference, here is the link for the documentation on “xlsread”:

カテゴリ

Help Center および File ExchangeSpectral Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by