⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resamp.txt

📁 Intel开发的IPP库的应用实例
💻 TXT
字号:
//
//
//                        INTEL CORPORATION PROPRIETARY INFORMATION
//        This software is supplied under the terms of the license agreement
//      or nondisclosure agreement with Intel Corporation and may not be copied
//      or disclosed except in accordance with the terms of that agreement.
//            Copyright (c) 1999-2006 Intel Corporation. All Rights Reserved.
//
//


        Polyphase resampling using Intel(R) Integrated Performance Primitives (Intel(R) IPP)

This program allows to change the sampling rate of the input sound file. The windowed
ideal lowpass filter is used for input data resampling. Input and output files files
contain raw 16-bit mono waveform data. To run the program, type:

resamp.exe (-f in out | -u factor) (-w window | -l length) [options] infile outfile
Option list:
  -f inrate outrate  Fixed filter is used for input rate <inrate> and output rate
                     <outrate> (defaults are 16000 and 11025)
  -u steps factor    Universal filter (default) with <steps> discretization steps per 1 and
                     resampling factor <factor> is used (defaults are 256 and 11025./16000.)
  -w window          Ideal lowpass filter window size (default is 64.0)
  -l length          Filter length (default is 1024)
  -r rollf           Roll-off frequency (default is 0.95)
  -a alpha           Kaiser window parameter (default is 9.0)
  -b bufsize         Data portion size in samples (default is 4000)
  -fast              ippAlgHintFast hint is used for IPP functions
  -float             Float point calculations
  infile             Input pcm file name (mono, 16 bit)
  outfile            Output pcm file name (mono, 16 bit)

For example, the input file could be converted from 22.05 KHz to 16 KHz by the command

  resamp -f 22050 16000 input.pcm output.pcm

Intel(R) IPP implementation of polyphase resampling supports two types of filters: universal and
fixed filter.

Universal filter is defined by the size of ideal lowpass filter window and the number of
discretization steps. The universal filter contains steps*windows/2 coefficients. Linear
interpolation of filter coefficients is used, so the universal filter could be used for
arbitrary resampling factor. The length of the filter is windows/MIN(1,factor). For
factor>1 resampling with factor=1 is done.

The fixed filter is used for the fixed ratio of input and output frequencies. It contains
length*outrate/GCD(inrate,outrate)+1 coefficients. The filter length is the minimal multiple
of 4 that in greater than or equal to length and +1 for zero phase. The window or the
corresponding ideal lowpass filter is equal to ((length+3)&~3)*MIN(1,factor).

The fixed filter is faster but could be very big for small GCD(inrate,outrate). The number
of filter coefficients for the universal filter with window=64 and steps=256 and corresponding
fixed filters are:

   inrate outrate    universal filter     fixed filter
                     length   coeffs     length   coeffs

   16000   11025       93       8193       92      40573
   11025   16000       64       8193       64      40961
      16      11       93       8193       96       1057
      11      16       64       8193       64       1025

Samples for the left filter shoulder for the first pSrc element precede it and samples for
the right filter shoulder for the last pSrc element follow it. The history size should be
at least length/2+1. Time is updated with the value (index+phase) for the first output sample
of the next function call.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -