필터 지우기
필터 지우기

location zero crossings of the signal

조회 수: 5 (최근 30일)
Roman
Roman 2012년 12월 14일
The following program produces sine signal plus noise. I have to write a function(Call zero crossing function that you see in the code below) in MATLAB to identify location zero crossings of the signal,found the locations where Signal changes sign.
clc
clear all
close all
N=1000; %Number of samples
n=0:N-1; % Sample index
Ts=0.0025; %Sample interval
f1=2; %freq=2Hz
%Generate signal+noise
x=0.5*sin(2*pi*f1*n*Ts+pi/4)+0.01*randn(size(n));
*_%Call zero crossing function
I=find_zero_cross_fnc(x);
s=zeros(size(I));_*
% Plot results
figure
stairs(x,'Linewidth',1), hold on
stem(I,s,'*r','Linewidth',3)
  댓글 수: 3
Roman
Roman 2012년 12월 18일
function(zero crossing) that identify location zero crossings of the signal,found the locations where Signal changes sign.
John Petersen
John Petersen 2012년 12월 18일
See my answer below.

댓글을 달려면 로그인하십시오.

답변 (1개)

John Petersen
John Petersen 2012년 12월 15일
You could let this be your zero crossing function.
zind = diff(x>0);

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by