MathWorks - Mobile View
  • MathWorks 계정에 로그인합니다.MathWorks 계정에 로그인합니다.
  • Access your MathWorks Account
    • 내 계정
    • 나의 커뮤니티 프로필
    • 라이선스를 계정에 연결
    • 로그아웃
  • 제품
  • 솔루션
  • 아카데미아
  • 지원
  • 커뮤니티
  • 이벤트
  • MATLAB 다운로드
MathWorks
  • 제품
  • 솔루션
  • 아카데미아
  • 지원
  • 커뮤니티
  • 이벤트
  • MATLAB 다운로드
  • MathWorks 계정에 로그인합니다.MathWorks 계정에 로그인합니다.
  • Access your MathWorks Account
    • 내 계정
    • 나의 커뮤니티 프로필
    • 라이선스를 계정에 연결
    • 로그아웃

비디오 및 웨비나

  • MathWorks
  • 비디오
  • 비디오 홈
  • 검색
  • 비디오 홈
  • 검색
  • 영업 상담
  • 평가판 신청
  Register to watch video
  • Description
  • Full Transcript
  • Related Resources

Data Acquisition in MATLAB Without Writing Code

Dan Seal, MathWorks

Common data acquisition tasks can be performed in MATLAB® without writing code. The Analog Input Recorder app allows you to acquire analog voltage, current, or audio data from supported devices. The Signal Analyzer app provides visualization and signal analysis capabilities. And you can output analog data using the Analog Output Generator app.

Each of these apps allows you to perform a task and then automatically generate the equivalent MATLAB code for that task so you can easily configure your environment and perform the same analysis again in the future. 
In this video, these steps are demonstrated using audio data as an example. Audio is recorded into MATLAB from a microphone, a low-pass filter is applied, and the resulting signal is generated on a speaker. The automatically generated MATLAB code is then assembled in a single MATLAB script that can run the whole workflow.

The Analog Input Recorder and Analog Output Generator apps are included with Data Acquisition Toolbox™. The Signal Analyzer app is included with Signal Processing Toolbox™.

In this video, I’ll show how you can acquire, analyze, and generate analog signals in MATLAB without writing code. To do this, you can use interactive apps in MATLAB.

To acquire data, you can use the Analog Input Recorder from Data Acquisition Toolbox. This app allows you to acquire analog voltage signals from supported DAQ devices and audio signals from audio devices. I’ll acquire audio data from my headset microphone. Let’s record five seconds’ worth of data while I whistle.

As you can see, this is recorded to the MATLAB workspace. Here it is in a timetable, which is nice because this single variable contains the timing information and the data. I can select the data and plot it in MATLAB. And if I zoom in, I can see that this audio data has a sinusoidal behavior.

Now if I want to perform this same acquisition configured the same way in the future, I can generate a script. This script provides me with the equivalent MATLAB code to perform these same steps in the future. Let’s save the script.

Now that I’ve acquired some data, what if I want to analyze it? I can use the Signal Analyzer app from Signal Processing Toolbox. This app offers me a number of things I can do with the data stored in this DAQ_1 timetable. I can visualize it in the time domain, but I can also look at it in the frequency domain or in a time-frequency plot. If I zoom into this region where I have the strongest frequencies, I can clearly see in the time-frequency plot those notes that I whistled.

In addition to visualizing data, I can also perform analysis like a low-pass filter. Let’s say I want to remove some of these higher frequencies. I can set a passband frequency of 1 kHz and bump up the steepness. As you can see, some of these higher frequencies are cut out and some of those higher notes that I whistled are no longer visible here.

From this app, I can export this new data into MATLAB, and I can also generate a function. You can see here that this function gives me the MATLAB code for creating that same low-pass filter with 1000 Hz passband frequency and a steepness of 0.9999. Let’s save this function.

I’ve acquired data. I’ve done some analysis. I can also output data. We can use the Analog Output Generator app from Data Acquisition Toolbox. I’ll output audio data to my computer’s soundbar. For comparison, I’ll first output the data that we originally recorded in the DAQ_1 variable. Now let’s listen to the data that we analyzed with that low-pass filter in DAQ_1_ch1.

As before, I can generate a script to perform these steps in the future. This again provides me with a MATLAB code version to perform the same configuration and signal generation.

Now I’ve generated the equivalent MATLAB code for each of these three steps. How do I tie them all together in a single workflow? Well, I’ve created this script template here, and I can take that automatically generated code and add it in. The code for AcquireAudio, GenerateAudio, and for the preprocessing step, we have a function with this signature. But instead of preprocessing x and tx, we preprocess the data that we acquired in this acquire audio step: data and timesteps. And this function gives us a variable y. So when we generate audio, instead of generating DAQ_1_ch1.ch1, we’ll generate the data in y. So let’s run this all together.

That’s how you can acquire, analyze, and generate analog data in MATLAB without writing code. Thank you.

Related Products

  • Data Acquisition Toolbox
  • Signal Processing Toolbox

Feedback

Featured Product

Data Acquisition Toolbox

  • Request Trial
  • Get Pricing

Up Next:

3:49
Connecting to DAQ Devices Without Writing Code

Related Videos:

53:22
Acquiring Data from Standalone Instruments and Data...
2:58
Data Acquisition in MATLAB
7:04
Overview - Data Acquisition Toolbox
55:21
Acquiring Data from Sensors and Instruments Using MATLAB

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: .

Select web site

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

  • 영업 상담
  • 평가판 신청

제품 소개

  • MATLAB
  • Simulink
  • 학생용 소프트웨어
  • 하드웨어 지원
  • File Exchange

다운로드 및 구매

  • 다운로드
  • 평가판 신청
  • 영업 상담
  • 가격 및 라이선스
  • MathWorks 스토어

사용 방법

  • 문서
  • 튜토리얼
  • 예제
  • 비디오 및 웨비나
  • 교육

지원

  • 설치 도움말
  • 사용자 커뮤니티
  • 컨설팅
  • 라이선스 센터
  • 지원 문의

회사 정보

  • 채용
  • 뉴스 룸
  • 사회적 미션
  • 영업 상담
  • 회사 정보

MathWorks

Accelerating the pace of engineering and science

MathWorks는 엔지니어와 과학자들을 위한 테크니컬 컴퓨팅 소프트웨어 분야의 선도적인 개발업체입니다.

활용 분야 …

  • Select a Web Site United States
  • 특허
  • 등록 상표
  • 정보 취급 방침
  • 불법 복제 방지
  • 매스웍스코리아 유한회사
  • 주소: 서울시 강남구 삼성동 테헤란로 521 파르나스타워 14층
  • 전화번호: 02-6006-5100
  • 대표자 : 이종민
  • 사업자 등록번호 : 120-86-60062

© 1994-2021 The MathWorks, Inc.

  • Naver
  • Facebook
  • Twitter
  • YouTube
  • LinkedIn
  • RSS

대화에 참여하기