how to make a signal in matlab from ultrasonic sensor?
7 次查看(过去 30 天)
显示 更早的评论
Hi everyone! I would like to ask what should I use to make a signal in matlab from ultrasonic sensors. I want to generate signals depending on what the sensors are detecting. For example, if I put a water bottle in front of the sensors, it would generate a signal and then I would try another object like a can, it would also generate a signal. Since its 2 different object, the possible signals are different. I want to know the equation needed to generate different signals depending on the detected object.
i= 1 : 10*4 % time vector
data(i) = str2double(fscanf(s1)); %scan from arduino
ix(i) = i/10;
%%Time specifications:
Fs = 100; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 1; % seconds
t = (0:dt:StopTime-dt)'; % wave per seconds
%%Sine wave:
x = sin(2*pi*t*data);
plot(x, 'b')
end;
This is my example of codes. It generates signal from sensors, but the problem is that it would generate the same structure of signals even though its an obvious different object. I want it to be different because I will use the data for object recognition
I hope someone can help me. Thanks.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Code Generation and Deployment 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!