Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • toolbox toolbox
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 4
    • Merge requests 4
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Institute of Technical Acoustics (ITA)
  • toolboxtoolbox
  • Issues
  • #37
Closed
Open
Issue created Jun 08, 2020 by Stefan Liebich@Stefan.LiebichDeveloper

Merging two itaAudio objects with different length

When merging two itaAudio objects with different length e.g. longrand = randn(1000,1); shortrand = randn(200,1); fs = 48000;

The behaviour depends on the signalType (energy or power).

%% merging power signals a = itaAudio(longrand,fs,'time'); b = itaAudio(shortrand,fs,'time'); ita_merge(a,b) % merge@itaAudio: signal length does not match, extracting samples. Some samples will be lost!

-> Here the longer signal is truncated and information is lost

% merging energy signals a = itaAudio(longrand,fs,'time'); a.signalType = 'energy'; b = itaAudio(shortrand,fs,'time'); b.signalType = 'energy'; ita_merge(a,b) % merge@itaAudio: signal length does not match, interpolation in frequency domain

-> Here the shorter signal is interpolated in the frequency domain by spline interpolation. Comment in code says "%Interpolation in frequency domain is safer, though not perfect"

Would it not make more sense to simply zero pad the shorter signal in both cases? Zeropadding leads to better resolution in frequency domain, when consequently increasing the fftSize, and thus and implicit "interpolation". If I am not mistaken, in the currently implemented way of interpolation will introduce some error into the signal, e.g. when going forth and back. Happy to discuss this here =)

merging_ita_obj.m

Assignee
Assign to
Time tracking