Hey all,
Part of my program is creating a melody of various sine waves and this all works as it should. It also saves the melody as a wav using audiowrite. When it saves, in the command line, i get orange warnings saying the signal clipped a bit.
Here's part of my code for the melody creation:
LPfiltX=designfilt('lowpassfir', 'PassbandFrequency', 1000, 'StopbandFrequency', 1100, 'PassbandRipple', 1, 'StopbandAttenuation', 60, 'SampleRate', Fs);
for i = 1:7;
tX = 0:1/Fs:1;
f = out(i);
SineZ{i} = sin(2*pi*f*tX);
end
Wave = cell2mat(SineZ);
t_p = linspace(0, length(Wave), length(Wave));
MyOPfiltCREATE=filter(LPfiltX,Wave);
Here's the orange warning text:
Warning: Data clipped when writing file.
> In audiowrite>clipInputData (line 396)
In audiowrite (line 176)
In EPM_gui_form>btSAVEWAV_Callback (line 269)
In gui_mainfcn (line 95)
In EPM_gui_form (line 33)
In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)EPM_gui_form('btSAVEWAV_Callback',hObject,eventdata,guidata(hObject))
Is there any way to stop it clipping. Can i assign a maximum amplitude to the melody (signal) or apply a filter or something at the creation stage to keep the signals below a certain level?
Any ideas?
Thanks,
Paul..