필터 지우기
필터 지우기

How to downsample a signal

조회 수: 166 (최근 30일)
Abdelhakim Souidi
Abdelhakim Souidi 2022년 6월 21일
댓글: Paul 2022년 6월 22일
I have read an audio signal .wav with a Sampling frequency fs = 44100
[y Fs]= audioread('as6.mp3');
[N,P]=size(y);
ts=1/Fs;
tmax=(N-1)*ts;
t=0:ts:tmax;
I am interested to study the frequencies under 8000 of this signal with the function downsampling ()
so, How can I do it
  댓글 수: 5
Abdelhakim Souidi
Abdelhakim Souidi 2022년 6월 22일
Paul if you can do me a favor, I want to see how to apply the Downsampling function in this case
Paul
Paul 2022년 6월 22일
Responding to is resample and downsample function are the same in this comment
Basic concepts:
downsample - In the basic case, equivalent to indexing with an integer step
x = rand(1,20);
N = 3;
isequal(x(1:N:end),downsample(x,N))
ans = logical
1
decimate - Applies a low pass filter to x to avoid aliasing before downsampling
upsample - Inserts zeros between elements of the input array
interp - Applies a filter after upsampling x
resample - When applied to uniformly spaced data, modifies the sampling rate by a rational multilple p/q. Filtering is involved. Don't know if resample and decimate (or interp) can be made to yield the same result with appropriate selection of input arguments.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2022년 6월 21일
Any resampling is not necessary. Just use the lowpass function to filter out everything above 8 kHz. (Use 'ImpulseResponse','iir' for the best results.)
  댓글 수: 4
Abdelhakim Souidi
Abdelhakim Souidi 2022년 6월 22일
thank you brother for clarification. I Want to know one more other thing is resample and downsample function are the same
Star Strider
Star Strider 2022년 6월 22일
My pleasure.
Apparently not, at least as far as I can tell.
Using the type function reveals that the two appear to be entirely independent. I thought that downsample might call resample, however it does not appear to do so:
type downsample.m
q = which('resample.m', '-all')
type(q{1})
I will leave that for you to do rather than displaying it here (although it does work here) since the code is copyrighted and should not be displayed on an open access site. (Be certain that the appropriate element of ‘q’ is the Signal Processing Toolbox version of resample so that you can see the correct function, since there are several different — I count 8 in the online documentation — resample functions.)
.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by