Skip to content
MathWorks - Mobile View
  • MathWorks アカウントへのサインインMathWorks アカウントへのサインイン
  • Access your MathWorks Account
    • マイ アカウント
    • コミュニティのプロファイル
    • ライセンスを関連付ける
    • サインアウト
  • 製品
  • ソリューション
  • アカデミア
  • サポート
  • コミュニティ
  • イベント
  • MATLAB を入手する
MathWorks
  • 製品
  • ソリューション
  • アカデミア
  • サポート
  • コミュニティ
  • イベント
  • MATLAB を入手する
  • MathWorks アカウントへのサインインMathWorks アカウントへのサインイン
  • Access your MathWorks Account
    • マイ アカウント
    • コミュニティのプロファイル
    • ライセンスを関連付ける
    • サインアウト

ビデオ・Webセミナー

  • MathWorks
  • ビデオ
  • ビデオ ホーム
  • 検索
  • ビデオ ホーム
  • 検索
  • 営業へのお問い合わせ
  • 評価版
4:27 Video length is 4:27.
  • Description
  • Full Transcript
  • Related Resources

Peak Analysis

Determine the period of a signal by measuring the distance between the peaks, and find peaks in a noisy signal using Signal Processing Toolbox™.

The peaks of a signal are most noticeable and useful features. And for that reason, peak analysis is an important area of signal processing. You may want to find out how many peaks are there in the signal, how far apart they are from each other, or whether they follow some kind of pattern. In this video, I will show you how you can detect, locate, and display peaks of signals using find peaks function. I will concentrate on two typical tasks—determining the period of a signal by measuring the distance between its peaks and finding peaks in a noisy signal.

Let us load some data into MATLAB®. The plot here shows the number of sunspots that have been observed over time for the last 300 years. Sunspots are spots or patches that appear on the surface of the sun.

Their number is known to vary periodically. The signal clearly contains many peaks. Let us use find peaks function to see where they are. The function blocks the signal and displays all the peaks when it is called with no output arguments.

You can limit the number of peaks displayed by using the end peaks option. Here, I have chosen to display the first 15 peaks. You may also want to filter out peaks that are so close to others that they do not provide new information. Use the min peak distance option to ignore those closely spaced peaks. Please refer to the documentation of find peaks for a list of available properties.

We can now calculate the distance between the maximum values to see how often the sunspot activity peaks. Find peaks reveals the amplitude of the peaks and their location. Applying the function to the signal returns a number of sunspots during peak years and the peak years themselves.

I set the min peak distance parameter to 6 to ignore closely spaced peaks. We see that the first peak occurred in the year 1705, the second in the year 1717, et cetera. There was a 12-year interval between the first and second peaks, 10 years between the second and third, and so on. We can use diff function on the peak years and find the average interval. This number turns out to be 10.96 years, which is approximately equal to the actual sunspot cycle of 11 years.

Next, we will see how to detect peaks in a noisy signal. Let us load a fragment of an ECG signal in MATLAB. Despite all the noise, we see a repeating structure in the ECG signal.

The most noticeable up-down pattern is called the QRS complex. Cardiologists use the properties of the QRS complex to diagnose abnormal heart behavior. The up peaks are called R waves. To detect them, set the min peak height option to 0.5 millivolts. There is a chance that some peaks that are not R waves may be higher than the 0.5 threshold because of noise. To filter out the false positives, we can impose a minimum peak-to-peak separation by setting the min peak distance to 200.

The down peaks right after the R waves are the S waves. To find them, we can proceed exactly as before after flipping the signal upside down. The dips right before the R waves are called the Q waves. These are harder to detect because they are much smaller and often buried in the noise. One solution is to eliminate some of the noise by using a smoothing filter. Savitzky-Golay filters are a popular tool to clean up signals.

If we plot the original and the smooth data, we can see that the filtering has made the Q waves stand out more clearly. We can now detect, locate, and display the Q peaks just like we did with the R and S waves. Once we have found and characterized the three sets of peaks, we are ready to study the ECG signal in detail. For more detailed information, please refer to the peak analysis example in the Signal Processing Toolbox documentation.

Related Products

  • Signal Processing Toolbox

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper

Feedback

Featured Product

Signal Processing Toolbox

  • Request Trial
  • Get Pricing

Up Next:

2:13
University of Cambridge Teaches Numerical Analysis to...

Related Videos:

24:05
Lithium Battery Model with Thermal Effects for System-Level...
48:06
Electrical Distribution System Modeling and Analysis in...
24:27
Debunking Misconceptions About Static Analysis
48:12
Using MATLAB with PI System for Analysis and Process...

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • Switzerland (English)
  • Switzerland (Deutsch)
  • Switzerland (Français)
  • 中国 (简体中文)
  • 中国 (English)

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • 営業へのお問い合わせ
  • 評価版

MathWorks

Accelerating the pace of engineering and science

MathWorksはエンジニアや研究者向け数値解析ソフトウェアのリーディングカンパニーです。

ディスカバー…

製品を見る

  • MATLAB
  • Simulink
  • 学生向けソフトウェア
  • ハードウェア サポート
  • File Exchange

製品評価版の入手または製品の購入

  • ダウンロード
  • 評価版ソフトウェア
  • 営業へのお問い合わせ
  • 価格とライセンス
  • MathWorksストア

使い方を学ぶ

  • ドキュメンテーション
  • チュートリアル
  • 例
  • ビデオ・Webセミナー
  • トレーニング

サポートを受ける

  • インストールのヘルプ
  • MATLAB Answers
  • 技術コンサルティング
  • ライセンスセンター
  • サポートへのお問い合わせ

MathWorks について

  • 採用情報
  • ニュースルーム
  • 社会貢献
  • ユーザー事例
  • MathWorks について
  • Select a Web Site United States
  • トラストセンター
  • 商標
  • プライバシー ポリシー
  • 違法コピー防止
  • アプリケーション ステータス

© 1994-2022 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

MATLAB を語ろう