setInputSampleRate
Description
setInputSampleRate(
sets the input sample rate of the input object to Obj,FsIn)FsIn.
When you change the input sample rate using the setInputSampleRate
function, other frequency properties of the object scale accordingly. You can view the input
sample rate information using the info function. For an example, see Specify Input Sample Rate in dsp.LowpassFilter Object.
Examples
Using SampleRate Argument
Specify the input sample rate explicitly while constructing the dsp.FIRFilter object using the SampleRate argument.
firFilt = dsp.FIRFilter(SampleRate=22050)
firFilt =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Property'
Numerator: [0.5000 0.5000]
InitialConditions: 0
Show all properties
You can view this information using the Input sample rate field of the info function.
info(firFilt)
ans = 7×35 char array
'Discrete-Time FIR Filter (real) '
'------------------------------- '
'Filter Structure : Direct-Form FIR'
'Filter Length : 2 '
'Stable : Yes '
'Linear Phase : Yes (Type 2) '
'Input sample rate : 22050 '
Visualize the frequency response of the filter using filterAnalyzer. Note the frequency range from 0 to 11025 Hz.
filterAnalyzer(firFilt,FilterNames="FIRFilter22050Hz")
Using setInputSampleRate Function
To specify the input sample rate after constructing the object, use the setInputSampleRate function.
setInputSampleRate(firFilt,44100)
To confirm, view the sample rate information using the info function.
info(firFilt)
ans = 7×35 char array
'Discrete-Time FIR Filter (real) '
'------------------------------- '
'Filter Structure : Direct-Form FIR'
'Filter Length : 2 '
'Stable : Yes '
'Linear Phase : Yes (Type 2) '
'Input sample rate : 44100 '
Visualize the frequency response of the filter using filterAnalyzer. Note the change in frequency interval from 0 to 22050 Hz.
filterAnalyzer(firFilt,FilterNames="FIRFilter44100Hz")
Specify the input sample rate explicitly while constructing the dsp.LowpassFilter object using the SampleRate argument.
lpFilter = dsp.LowpassFilter(SampleRate=24050)
lpFilter =
dsp.LowpassFilter with properties:
FilterType: 'FIR'
DesignForMinimumOrder: true
PassbandFrequency: 8000
StopbandFrequency: 12000
PassbandRipple: 0.1000
StopbandAttenuation: 80
NormalizedFrequency: false
SampleRate: 24050
Show all properties
You can view this information using the Input sample rate field of the info function.
info(lpFilter)
ans = 7×35 char array
'Discrete-Time FIR Filter (real) '
'------------------------------- '
'Filter Structure : Direct-Form FIR'
'Filter Length : 15 '
'Stable : Yes '
'Linear Phase : Yes (Type 1) '
'Input sample rate : Normalized '
To specify the input sample rate after constructing the object, use the setInputSampleRate function.
setInputSampleRate(lpFilter,44100)
When you change the input sample rate using this function, other frequency properties of the object scale accordingly.
lpFilter
lpFilter =
dsp.LowpassFilter with properties:
FilterType: 'FIR'
DesignForMinimumOrder: true
PassbandFrequency: 1.4669e+04
StopbandFrequency: 2.2004e+04
PassbandRipple: 0.1000
StopbandAttenuation: 80
NormalizedFrequency: false
SampleRate: 44100
Show all properties
Change the sample rate to "normalized" and the other frequency properties change accordingly.
setInputSampleRate(lpFilter,"normalized")
lpFilterlpFilter =
dsp.LowpassFilter with properties:
FilterType: 'FIR'
DesignForMinimumOrder: true
PassbandFrequency: 0.6653
StopbandFrequency: 0.9979
PassbandRipple: 0.1000
StopbandAttenuation: 80
NormalizedFrequency: true
Show all properties
Input Arguments
Input filter, specified as one of these objects:
Input sample rate, specified as a positive scalar or the string
"normalized".
Version History
Introduced in R2026a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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
- United Kingdom (English)