Error using tsa function - Error using matlab.internal.math.interp1 Sample points must be unique.
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lars Dierickx
el 18 de Abr. de 2024
Comentada: Mathieu NOE
el 19 de Abr. de 2024
While I've allready succesfully used the tsa function in the past, I stumbled upon the error as shown below, which I'm not able to get rid of. Intuitively I tried using the unique function to exclude possible duplicates in my TachoPulseTimes vector, but this didn't appear to solve the issue. I also tried swapping the sampling frequency argument fs for the corresponding time vector to make sure both the sampling time vector and tacho pulse times would start and end on equal time stamps, but with no luck. Any help would be much appriciated given I'm completly stuck at the moment.
load('TSA_DATA.mat')
AccData = upsample(tsaData.AccData,100);
fs = tsaData.SampFreq;
TachoPulseTimes = tsaData.TachoPulseTimes;
pprTacho = tsaData.pprTacho;
accDataTsaRaw = tsa(AccData,fs,TachoPulseTimes,"PulsesPerRotation",pprTacho);
Note: The accelerometer data was downsampled with a factor 100 to be able to include the data as attachment
Many thanks in advance,
Lars
Respuesta aceptada
Mathieu NOE
el 19 de Abr. de 2024
Editada: Mathieu NOE
el 19 de Abr. de 2024
hehe
there is only one difference between the two mat files , but it was enough to create the issue
>> load('TSA_DATA_OLD.mat') => AccData: [1×16501 double]
>> load('TSA_DATA.mat') => AccData: [1×254977 single]
so in the second case , don't forget to convert from single to double before calling tsa
AccData = upsample(double(tsaData.AccData),100)
3 comentarios
Mathieu NOE
el 19 de Abr. de 2024
maybe something worth to write as a comment in your code ...
all the best
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!