How do I apply a function to every resulting element of a buffer function?

조회 수: 4 (최근 30일)
I've split the sound signal into frames of 256 length using buffer function.
Now I have 256x544 "frames" variable with 256 rows and 544 columns inside when I see it through "Open Selection".
How do I apply a function, e.g. hamming(256), to each column?

채택된 답변

Star Strider
Star Strider 2022년 10월 3일
How do I apply a function, e.g. hamming(256), to each column?
Do an element-wise multiplication —
v = randn(256,2)
v = 256×2
1.2764 -0.1904 0.9324 0.2411 -1.0898 -0.4778 -1.3075 2.2502 -1.5342 1.5244 0.2590 -0.9400 -0.1452 -0.8611 0.5434 0.7781 -0.0220 1.0027 -0.2428 -2.5638
vh = v.*hamming(256)
vh = 256×2
0.1021 -0.0152 0.0747 0.0193 -0.0878 -0.0385 -0.1062 0.1828 -0.1262 0.1254 0.0216 -0.0785 -0.0123 -0.0732 0.0472 0.0676 -0.0020 0.0891 -0.0222 -0.2340
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by