Importing timeseries with different sampling rate into simulink loses data?

조회 수: 3 (최근 30일)
Javier Cuadros
Javier Cuadros 2020년 8월 28일
편집: Stefanie Schwarz 2020년 9월 8일
Hello all,
I have been seeing some spooky effect in my simulations, I could have traced it to what I think is the importing of the time series into simulink. Let's me show what I do,
  • I create a 802.11p signal with wlan tool box
cfgNHT = wlanNonHTConfig;
cfgNHT.ChannelBandwidth = 'CBW10';
cfgNHT.PSDULength = psduLen;
cfgNHT.MCS = mcs;
%% Packet parameters
% Create random data; PSDULength is in bytes
savedState = rng(0); % Set random state
data = randi([0 1],cfgNHT.PSDULength*8*numPackets,1);
% Generate a multi-packet waveform
waveForm80211p = wlanWaveformGenerator(data,cfgNHT, 'NumPackets',100,'IdleTime',3.6e-3/10);
fs = wlanSampleRate(cfgNHT);
  • Convert that signal into a timeseries to import into simulink
s = timeseries(txWaveform,1:length(txWaveform));
s.Time = s.Time/fs;
  • Import s signal into simulink via a From Workspace block using sample time 1/fs
  • Change the sample rate of s within simulink to 1/(64*fs) using a RateTransition block since my model runs with that simulation step
Something as shown below
  • Run the simulation
Then what I observe is that for certain 802.11p signals, its SFT are not looking as they supposed to look like, they look like this ( yellow signal)
whereas they should looke like this
THe above two scrreenshots are coming from the same simulation as shown below
So it seems that sometimes the timeseries s is not properly either imported or re-sampled by simulink, since if I plot out.s_simulink I get this
Any ideas why is this happening? Is a bug in Simulink when importing the timeseries to an different sampling rate model?

답변 (1개)

Stefanie Schwarz
Stefanie Schwarz 2020년 9월 8일
편집: Stefanie Schwarz 2020년 9월 8일
This is probably the result of the Interpolation settings in your From Workspace block. Please see the following MATLAB Answers post regarding why it looks like data is being lost when you disble interpolation:

카테고리

Help CenterFile Exchange에서 WLAN Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by