Chopping a wave(signal)
Show older comments
I have a long waveform but i am interested in a small segment of the waveform.How do I chop the signal in matlab?
Answers (1)
Fangjun Jiang
on 9 Jun 2011
Can you clarify? Could be very simple.
t=0:0.1:10;
signal=sin(t);figure(1);plot(signal);
NewSignal=signal(1:50);figure(2);plot(NewSignal);
2 Comments
Paulo Silva
on 9 Jun 2011
instead of the signal(1:50) we can use the time vector like this
signal(t<=5) %just the first five seconds
Fangjun Jiang
on 9 Jun 2011
Nice, that could facilitating a better plot (with the right x axle mark). Thanks!
Selection=(t>1) & (t<6)
plot(t(Selection),signal(Selection));
Categories
Find more on Time-Frequency Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!