1

関数を使用して読み込まれた単一のメモから個々のメモを作成していwavreadます。

resample関数を使用してこれらのメモを作成しています。例えば:

    f5  = resample(a,440,698); %creates note.
    f5_short  = f5(dur:Hz);    %creates duration of note (ie 1 sec)
    f5_hf  = f5_short(dur:Hz/2); %creates note of half duration

上記のコードはうまくいくようです。残念ながら、「二重音符」を作成するのに問題があります...同じ音符を2回演奏したくないので、次のことを試しました:

    f5_db  = f5_short(dur*2:Hz); %exceeds size of matrix
    f5_db  = f5_short(dur:Hz*2); %exceeds size of matrix
    f5_db  = resample(f5_short,Hz*2,330); %tried upSampling it and although lengths it, note becomes deeper.

ノートを変更せずに not/wav の長さを 2 倍にする最も簡単な理由は何ですか? (引き延ばして正しい音符を維持しますか?) ありがとうございます。

4

1 に答える 1

2

f5_shortインデックスを作成するのではなく、 のサイズを 2 倍にする必要があります。

f5_db = repmat(f5_short, 2, 1);

あるいは単に

f5_db = [f5_short; f5_short];

の最初と最後に一時停止がありますf5_shortが、途中のシーケンスが一定の場合は、途中を再現して二重音を得ることができます。このようなもの:

f5_short_len = length(f5_short);
f5_short_mid = floor(f5_short_len/2);
f5_db = [f5_short(1:f5_short_mid,:); ...
         repmat(f5_short(f5_short_mid,:),f5_short_len,1); ...
         f5_short(f5_short_mid+1:f5_short_len,:)];

一時停止を削除したい場合。

f5_short = repmat(f5_short(f5_short_mid),f5_short_len,1);
f5_db = repmat(f5_short, 2, 1);
于 2013-04-10T16:14:06.847 に答える