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;
savedState = rng(0);
data = randi([0 1],cfgNHT.PSDULength*8*numPackets,1);
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
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?