saeshma_overlap_S_A_conv_ref.zip

  • Aeshma
    了解作者
  • matlab
    开发工具
  • 3.9MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2021-02-08 02:58
    上传日期
overlap and save method using convolution, performance comparison
saeshma_overlap_S_A_conv_ref.zip
  • overlap_S_A_conv_ref.m
    1.1KB
  • Immigrant Song.mp3
    4MB
内容介绍
clear all; close all; clc; [x1, Fs] = audioread('Immigrant Song.mp3'); player0 = audioplayer(x1, Fs); % play(player0) % stop(player0) x = x1(:,1) + x1(:,2); player1 = audioplayer(x, Fs); % play(player1) % stop(player1) b = [0.2]; a = [1 -0.8]; [h,t] = impz(b,a); %% Overlap and add L = length(x); M = length(h); Q = 100; Nblocks = floor(L/Q); ni = (1:Q)'; no = (1:M+Q-1)'; y = zeros(L+M-1,1); y(no) = conv(h,x(ni)); for m=1:Nblocks-1 z = conv(h,x(m*Q+ni)); y(m*Q+no) = y(m*Q+no)+z; end yOAM = y; player2 = audioplayer(yOAM, Fs); % play(player2) % stop(player2) %% Overlap and Save % Overlap-Save Method L = length(x); M = length(h); if Q >= M else end; P = Q-M+1; % Overlap Nblocks = floor((L-Q)/P+1); y = zeros(L+M-1,1); y(1:Q) = cconv(h,x(1:Q-M),Q); z = cconv(h,x(1:Q),Q); y(P:Q) = z(P:Q); for m = 1:Nblocks-1 z=cconv(h,x(m*P+(1:Q)),Q); y(Q+(m-1)*P+(1:M))= z(P:Q); end yOSM = y; player3 = audioplayer(yOAM, Fs); % play(player3) % stop(player3) %%%%%%%%%%%%%%%%%%%%%%%%%%5 % N=length(h)+length(x)-1; % y=ifft(fft(h,N).*fft(x,N));
评论
    相关推荐