Engineer - mechanices /ekectronics / signal processing

Average matlab user for 20 years now.

Professional Interests: signal processing, adaptive control, noise and vibration processing

Answered

Displacement from accelerometer data

hello the drift in the displacement is due to the fact that the velocity itself is not a zero mean signal so if you are inte...

Displacement from accelerometer data

hello the drift in the displacement is due to the fact that the velocity itself is not a zero mean signal so if you are inte...

14 minuter ago | 0

Answered

How to fscanf a text file of characters to a string array/vector, but not a 1x1 string?

hello try this : fid=fopen('sample.txt', 'rt') data=split(fscanf(fid,'%c')) fclose(fid); % gives : data = 6×1 cell a...

How to fscanf a text file of characters to a string array/vector, but not a 1x1 string?

hello try this : fid=fopen('sample.txt', 'rt') data=split(fscanf(fid,'%c')) fclose(fid); % gives : data = 6×1 cell a...

21 minuter ago | 0

Answered

Plots giving me straight lines instead of harmonic oscillation lines

Hello there were some bugs ... where to start ? first the way you order the recursive equations can have some importance us...

Plots giving me straight lines instead of harmonic oscillation lines

Hello there were some bugs ... where to start ? first the way you order the recursive equations can have some importance us...

ungefär 6 timmar ago | 0

| accepted

Answered

Trying to plot my bandpass filtered signal in a time series, but I need to divide the x values by 2000 (the sampling rate) to get it to plot in seconds instead of samples/seconds

hello Rachel in most of my matlab code, I have to get the samples amount and define explicitly the time vector like this samp...

Trying to plot my bandpass filtered signal in a time series, but I need to divide the x values by 2000 (the sampling rate) to get it to plot in seconds instead of samples/seconds

hello Rachel in most of my matlab code, I have to get the samples amount and define explicitly the time vector like this samp...

ungefär 22 timmar ago | 0

Answered

only reading and plotting data for one file while I want it to read and plot data for 12 files

hello all plots are updated at each loop iteration on the same figure(1) so at the end you have only one figure showing the la...

only reading and plotting data for one file while I want it to read and plot data for 12 files

hello all plots are updated at each loop iteration on the same figure(1) so at the end you have only one figure showing the la...

ungefär 23 timmar ago | 0

Answered

How to smooth a graph?

hello see below some examples of how to smooth data; plenty of possibilities... Fs = 1000; samples = 1000; dt = 1/Fs; t = ...

How to smooth a graph?

hello see below some examples of how to smooth data; plenty of possibilities... Fs = 1000; samples = 1000; dt = 1/Fs; t = ...

ungefär 23 timmar ago | 0

Answered

How can I find when a signal stops oscillating more than a certain value?

hello sure it's doable use the attached code example to do a first derivative of your data, and then find the first index of...

How can I find when a signal stops oscillating more than a certain value?

hello sure it's doable use the attached code example to do a first derivative of your data, and then find the first index of...

ungefär 24 timmar ago | 0

Answered

Getting the Fundamental Frequency from Line to Line Voltage without distorting the signal.

hello I have not really understood what the purpose of Y data from the figure was, but I guessed that the plan was to get the "...

Getting the Fundamental Frequency from Line to Line Voltage without distorting the signal.

hello I have not really understood what the purpose of Y data from the figure was, but I guessed that the plan was to get the "...

en dag ago | 0

Answered

read each line a text file using Matlab function

hello Nadia if you use readvars, you have to know / specify how many variables you want to output example , if I specify on...

read each line a text file using Matlab function

hello Nadia if you use readvars, you have to know / specify how many variables you want to output example , if I specify on...

en dag ago | 0

Answered

while loop in a for loop

hello again official answer below : code fixed !! the output of the function was incorrect (wrong index and not at the right...

while loop in a for loop

hello again official answer below : code fixed !! the output of the function was incorrect (wrong index and not at the right...

3 dagar ago | 1

| accepted

Answered

Zeros between Sign Change of Values in column

hello this is my suggestion below + see attachements data = importdata('data.txt'); x = data(:,1); y = data(:,2); thr...

Zeros between Sign Change of Values in column

hello this is my suggestion below + see attachements data = importdata('data.txt'); x = data(:,1); y = data(:,2); thr...

8 dagar ago | 0

Answered

I want to do loop operation of these files but fail to get the desired result. Can anyone help me to figure out the problem?

hello I tweaked a bit your code , if fact it was simpler in my opinion to do the full 4 x 4 loops instead of doing the specifi...

I want to do loop operation of these files but fail to get the desired result. Can anyone help me to figure out the problem?

hello I tweaked a bit your code , if fact it was simpler in my opinion to do the full 4 x 4 loops instead of doing the specifi...

8 dagar ago | 0

| accepted

Answered

Assign same linewidth to a grouped barplot

hello v1=rand(10,1); v2=rand(10,1); x=[1:10]; combined=[v1,v2]; barplot=bar(x,combined,'grouped'); barplot(1).BarWidth = ...

Assign same linewidth to a grouped barplot

hello v1=rand(10,1); v2=rand(10,1); x=[1:10]; combined=[v1,v2]; barplot=bar(x,combined,'grouped'); barplot(1).BarWidth = ...

8 dagar ago | 1

| accepted

Answered

Generate Frequency domain with FFT function of 3-axis accelerometer data

hello see this example - you can adapt it to your own needs all the best %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load s...

Generate Frequency domain with FFT function of 3-axis accelerometer data

hello see this example - you can adapt it to your own needs all the best %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load s...

8 dagar ago | 0

Answered

Remove rows from table identified in a second string array

hello Christopher thi would be my suggestion notice I changed the last 3 names in Post_Inflate_names to get a matching case ...

Remove rows from table identified in a second string array

hello Christopher thi would be my suggestion notice I changed the last 3 names in Post_Inflate_names to get a matching case ...

9 dagar ago | 0

Answered

Fit an exponential function to time-series data

hello this is the poor man solution without any toolbox data was stored in txt file your B = -1/b_sol from my code below ...

Fit an exponential function to time-series data

hello this is the poor man solution without any toolbox data was stored in txt file your B = -1/b_sol from my code below ...

9 dagar ago | 1

Answered

How to identify datasegments that correlate to a given frequency

hello Katy I built this on your code, so first option is to see if the time interval between consecutive peaks are similar or n...

How to identify datasegments that correlate to a given frequency

hello Katy I built this on your code, so first option is to see if the time interval between consecutive peaks are similar or n...

9 dagar ago | 0

Answered

Rename dynamically columns name of a vector inside of a for loop

hello Sara if you stick to the eval method , this is how you should code it : eval(['d_' num2str(kk) ' = d;'])

Rename dynamically columns name of a vector inside of a for loop

hello Sara if you stick to the eval method , this is how you should code it : eval(['d_' num2str(kk) ' = d;'])

9 dagar ago | 0

| accepted

Answered

How can I change the color of the face of a cube created using the slice command?

hello use handles to modify face colors here I changes all external faces to black [X,Y,Z] = meshgrid(0:3); V = X.*exp(-X....

How can I change the color of the face of a cube created using the slice command?

hello use handles to modify face colors here I changes all external faces to black [X,Y,Z] = meshgrid(0:3); V = X.*exp(-X....

9 dagar ago | 0

Answered

How do I add noise to a sine wave signal to get the output below

hello simply the time vector was not correct , just define it once for all plots (and with max value = 10 s and not 1 s) als...

How do I add noise to a sine wave signal to get the output below

hello simply the time vector was not correct , just define it once for all plots (and with max value = 10 s and not 1 s) als...

9 dagar ago | 1

| accepted

Answered

Reading data from multiple files in ascending order.

hello this is my suggestion , based on natsortfiles (from FEX : Natural-Order Filename Sort - File Exchange - MATLAB Central ...

Reading data from multiple files in ascending order.

hello this is my suggestion , based on natsortfiles (from FEX : Natural-Order Filename Sort - File Exchange - MATLAB Central ...

13 dagar ago | 0

| accepted

Answered

How to specify order of a Moving Average Filter?

hello a moving average filter has only a window length (and window type) as parameters, the order is not meaningfull here may...

How to specify order of a Moving Average Filter?

hello a moving average filter has only a window length (and window type) as parameters, the order is not meaningfull here may...

13 dagar ago | 1

| accepted

Answered

Hysteresis curve and envelope

hello Emily this is how I solved it (blue curve) hope it helps %Column 2 Force vs Displacement clc;clear;close all; %Tra...

Hysteresis curve and envelope

hello Emily this is how I solved it (blue curve) hope it helps %Column 2 Force vs Displacement clc;clear;close all; %Tra...

14 dagar ago | 0

| accepted

Answered

How can specify interval of variables in fsurf?

hi see 'MeshDensity' — Number of evaluation points per direction Control Resolution of Surface Plot Control the resolution o...

How can specify interval of variables in fsurf?

hi see 'MeshDensity' — Number of evaluation points per direction Control Resolution of Surface Plot Control the resolution o...

15 dagar ago | 0

| accepted

Answered

Reduce the error formed due to unexpected condition in time series data. Time series correction

hello see some suggestions for data correction and smoothing in my code below hope it helps all the best clc close a...

Reduce the error formed due to unexpected condition in time series data. Time series correction

hello see some suggestions for data correction and smoothing in my code below hope it helps all the best clc close a...

15 dagar ago | 0

Answered

How to plot these traces after a fixed interval?

hello this is it : C = randn(2000,30); data = filter(ones(1,100),1,C); ind = [5, 15, 25]; % your angles figure(1), w...

How to plot these traces after a fixed interval?

hello this is it : C = randn(2000,30); data = filter(ones(1,100),1,C); ind = [5, 15, 25]; % your angles figure(1), w...

16 dagar ago | 0

Answered

FFT and time domain

hello see my example below I used nfft = 48 and 95% overlap to have best display of spectrograms clc clearvars %%%%%%%%...

FFT and time domain

hello see my example below I used nfft = 48 and 95% overlap to have best display of spectrograms clc clearvars %%%%%%%%...

16 dagar ago | 0

Answered

How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

hello If you have the Signal Processing Tbx, envelope was made for you clear all;close all; clc; xss=0.01; wf=40; wn=2...

How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

hello If you have the Signal Processing Tbx, envelope was made for you clear all;close all; clc; xss=0.01; wf=40; wn=2...

16 dagar ago | 0

Answered

I have multiple signal plots in one graph and i want to add their amplitudes to get one graph only

hello here you are : n1=1.45; n2=2.65; c=299792458; a=259*10^-9; b=142*10^-9; G=a+b; Lambda0=1.5*10^-6; Omega0=2*pi...

I have multiple signal plots in one graph and i want to add their amplitudes to get one graph only

hello here you are : n1=1.45; n2=2.65; c=299792458; a=259*10^-9; b=142*10^-9; G=a+b; Lambda0=1.5*10^-6; Omega0=2*pi...

16 dagar ago | 0

| accepted

Answered

Finding the time in which a specific value is reached in time-series data when peaks are found

hello I would suggest you use first a lowpass filter with long enought time constant (equivalent to moving average with buffe...

Finding the time in which a specific value is reached in time-series data when peaks are found

hello I would suggest you use first a lowpass filter with long enought time constant (equivalent to moving average with buffe...

16 dagar ago | 0