How to reduce the sample rate of a over sampled signal? (How to connect data to lines and sample?)
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Minghao Dong
le 10 Août 2019
Commenté : Star Strider
le 11 Août 2019
Hi Team,
I have a set of date, for example, sampled at 491.52-MHz. However, I want them to be sampled at 300-MHz using matlab processing. I am thinking I should use the original 491.52-MHz sampled data to reconstruct the original signal and then sample the new reconstructed signal with 300-MHz sample rate. Can anyone help me how to achieve it
The 491.52-MHz data is in attachment.
0 commentaires
Réponse acceptée
Star Strider
le 10 Août 2019
Working with your Excel file was something of an adventure!
I assume ‘n’ are nanoseconds and ‘u’ are microseconds. The plot works correctly with those assumptions.
Try this:
[D,S] = xlsread('1.csv');
t = cellfun(@(x)sscanf(x, '%f'), S(3:end,3), 'Uni',0); % Recover Time Vector
nu = regexp(S(:,3), '[un]', 'match'); % Recover ‘n’ & ‘u’
nv = strcmp([nu{:}],'n'); % Logical Vector: ‘n’
uv = strcmp([nu{:}],'u'); % Logical Vector: ‘u’
mult = [[0, nv(nv)]*1E-9, uv(uv)*1E-6]; % Create Multiplier Vector From ‘n’ and ‘u’
t = cell2mat([D(1,1); t]); % Concatenate With Initial ‘t’
tv = t .* mult(:); % Reconstruct ‘t’ With Multipliers
s = D(:,2); % Signal Vector
ts = sortrows([tv, s]); % Reconstructed Time & Waveform Matrix
% Ts = mean(diff(ts(:,1))), Tsd = std(diff(ts(:,1))), Fs = 1/Ts % Original Values
Fs = 300E+6; % Desired Resampling Frequency: 300MHz
[sr, tr] = resample(ts(:,2), ts(:,1), Fs); % Resample Using Original ‘t’ & ‘s’
figure
plot(ts(:,1), ts(:,2))
grid
title('Original Signal')
figure
plot(tr, sr)
grid
title('Resampled Signal')
That should give you the resultl you want.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Measurements and Feature Extraction dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!