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

비디오 및 웨비나

  • MathWorks
  • 비디오
  • 비디오 홈
  • 검색
  • 비디오 홈
  • 검색
  • 영업 담당 문의
  • 평가판 신청
6:03 Video length is 6:03.
  • Description
  • Full Transcript
  • Related Resources

How to Process Signals as Frames in Simulink

Learn how to use frame-based processing in Simulink® models to accelerate simulations and mimic the behavior of real-time systems. Paired with DSP System Toolbox™, you can configure signal processing blocks to create and operate on frames of data, allowing for multiple samples to be handled in a single timestep. See how to use Simulink graphical features including signal dimension labels and color-coded sample times to inspect and debug system models. You can also use the Simulink Profiler to assess the effects of differing data frame sizes on simulation performance.

Grouping and processing signal data as frames in Simulink models can often lead to improved simulation performance. It also more closely mimics how streams of signal data are handled by real-time digital signal processing systems allowing for more accurate simulations of real world behavior in hardware. In this video, we'll cover the basics of working with frames in Simulink including introducing them to a model, enabling blocks for frame-based processing, and evaluating the effects of differing frames sizes. Frames in Simulink are analogous to working with vectors in MATLAB. Vectorized MATLAB code often runs faster than the corresponding code containing loops.

This is because the number of times the MATLAB interpreters called is lowered, reducing the overheads on code execution. Similarly, processing data as frames in Simulink decreases overheads from calling the Simulink scheduler leading to faster simulation. Paired with DSP System Toolbox, Simulink offers a range of blocks to model and simulate signal processing systems. Signal processing blocks can be configured to handle samples or frames of data as specified by their block parameters. In sample-based processing, blocks process signals one sample at a time from either one or more channels.

For example, here, two channels feed into the square block, but only one sample from each channel is processed at every time step. Alternatively, when blocks are enabled for frame-based processing, they process signals in groups of sequential samples called frames. The frame shown here has two channels each with five sequential samples. The number of columns represent the channels per frame, while the number of rows represent the samples per channel. The same multi-channel signal is now processed in a frame-based manner.

In a single time step, multiple samples from one or more channels are processed. To demonstrate the improved performance achievable with frame-based processing, let's take a look at an example of an application in audio signal processing. In the model, a stereo audio file is imported and processed to add a series of sound effects. The stop time of the model is set for 10 seconds. After being read by the From Multimedia File block, the audio signal is passed through a cascaded byquadratic filter with three sections, a flanger effect block, reverberator block, and is finally written to the MATLAB workspace.

Inspecting the byquadratic filter further, we can see that each filter section is set to operate with frame-based processing. The flanger and reverb blocks are configured to inherit the signal sample rate. To confirm that the model will simulate with correctly sized data frames, let's first set the audio frame size parameter of the From Multimedia Block to be 256 samples per frame. Now let's open the Debug menu and enable Signal Dimensions and Sample Time Colors under Information Overlays. As we can see, each block in the model operates on signal inputs of size 256x2 as intended.

We expect to see two columns in the frames as stereo audio signals have two channels for left and right sound. Now we're ready to start simulating. To assess the model's performance, we'll make use of the Simulink Profiler located in the Debug menu. First, let's simulate the example model with a frame size of 256 samples, as said previously. Let's run the model with the Profiler to generate a profiler report containing the performance results.

Now, let's increase the audio frame size parameter of the source block to be 1,024 samples per frame, and run the Profiler a second time. Let's add a second Report Panel so that we can compare the two profiler reports side by side. Compared to the second simulation with 1,024 samples per frame, we can see that the simulation run with 256 samples per frame required a greater amount of time and number of calls to blocks in the model to complete. By plotting simulation time and the number of calls to blocks for each simulation using data from the profiler reports, the relationship between performance and frame size is quickly recognizable. As signals processed with a greater number of samples per frame require fewer block calls, simulations benefit from reduced Simulink scheduler overhead needing to improve performance.

However, a trade-off exists in that larger frames also consume more memory, which can negatively affect the performance of complex models. In general, it's worthwhile to experiment with different frame sizes to find one that maximizes simulation performance for your model. To summarize, introducing frames into a Simulink model reduces overheads and improves simulation performance. Frame-based processing also closely mimics the ways in which real-time systems collect and operate on streams of data. Simulink provides functionality for modeling, designing, and testing signal processing systems with blocks with native support for frame-based signals.

In the example we worked with, we only needed to change the audio frame size parameter of the source block to experiment with the effects of differing frame sizes across the model. And graphical features such as signal dimensions and color-coded sample times can be used to quickly view and inspect signals in your system architecture aiding in design and testing. For examples and more information on frame-based processing in Simulink, please visit our documentation.

Related Products

  • DSP System Toolbox
  • Audio Toolbox
  • Simulink

Learn More

Inspect Sample and Frame Rates in Simulink
Convert Sample and Frame Rates in Simulink
Download Models

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper
Related Information
Sample- and Frame-Based Concepts

Feedback

Featured Product

DSP System Toolbox

  • Request Trial
  • Get Pricing

Up Next:

36:42
Simulink: Tips and Tricks

Related Videos:

41:49
How to Develop Interactive User Interfaces for Simulink...
4:05
Grouping Large Arrays of Signals in a Model
16:36
Renault's Model-Based Design Powertrain Control Development...
20:44
Renault Model-Based Design Power Train Control Development...

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 스토어

사용 방법

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

지원

  • 설치 도움말
  • MATLAB Answers
  • 컨설팅
  • 라이선스 센터
  • 지원 문의

회사 정보

  • 채용
  • 뉴스 룸
  • 사회적 미션
  • 고객 사례
  • 회사 정보
  • Select a Web Site United States
  • 신뢰 센터
  • 등록 상표
  • 정보 취급 방침
  • 불법 복제 방지
  • 애플리케이션 상태
  • 매스웍스코리아 유한회사
  • 주소: 서울시 강남구 삼성동 테헤란로 521 파르나스타워 14층
  • 전화번호: 02-6006-5100
  • 대표자 : 이종민
  • 사업자 등록번호 : 120-86-60062

© 1994-2022 The MathWorks, Inc.

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

대화에 참여하기