現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
How come I keep getting "Data Clipped" in my Command Window?
2 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Star Strider
2014 年 4 月 29 日
編集済み: Star Strider
2014 年 4 月 29 日
You need to scale fur so that the maximum value is between [-1 +1] with wavwrite. Nice choice, BTW!
22 件のコメント
Edgar
2014 年 4 月 29 日
Could you show me the end result of how the line of code should look like that can resolve my issue? And where do I paste it?
Star Strider
2014 年 4 月 29 日
編集済み: Star Strider
2014 年 4 月 29 日
I no longer have wavwrite ( MATLAB R2014a has audioread and audoiwrite ) but the easiest way to scale fur to [-1 +1] is simply:
fur = fur/max(abs(fur));
Put it just before your wavwrite statement.
Edgar
2014 年 4 月 29 日
When I added the code. I still get the data clipped message. See attached. Any suggestions?
Star Strider
2014 年 4 月 29 日
As Walter Roberson noted in a similar answer, it may be necessary to scale it so that it’s never exactly [-1 +1].
Change the statement to :
fur = fur/max(abs(fur)+eps);
There’s a similar thread that started a few minutes ago.
Edgar
2014 年 4 月 29 日
Ahaha wow this is something else. I am still getting the same clipped message :(
Star Strider
2014 年 4 月 29 日
Your code doesn’t look very long. Post it as an attachment to your original question (use the ‘paperclip’ icon above the window). I'll run it and see if I can reproduce the error, and if all goes well, suggest a fix for the problem.
Star Strider
2014 年 4 月 29 日
I would appreciate your formatting it. I makes it easier to read and copy. Highlight your code, then click the [{}Code] button above the window.
Edgar
2014 年 4 月 29 日
Do you have an email address I could send you my code? I tried to post it, but .docx file is unsupported here for some odd reason.
Star Strider
2014 年 4 月 30 日
編集済み: Star Strider
2014 年 4 月 30 日
It works perfectly for me.
I experimented, and changing the scaling line to:
fur = fur/max(abs(fur)+1E-4);
doesn’t change the sound, and no longer generates the ‘clipping’ warning! (Even adding 1E-5 generated the ‘clipping’ warning. Strange.)
Also, I suggest you change the fft plot to:
plot(f,abs(z))
to plot the amplitude of the fft. Otherwise, the plot only plots the real part, and gives a warning about ignoring the imaginary part. You might also consider:
axis([-750 750 ylim])
just after the plot statement. There doesn’t seem to be anything of significance outside those limits.
Star Strider
2014 年 4 月 30 日
編集済み: Star Strider
2014 年 4 月 30 日
It’s not your version of MATLAB, it’s some sort of idiosyncrasy in wavwrite. I’m getting it too in R2014a. That’s probably the reason audiowrite and audioread are replacing the others.
Edgar
2014 年 4 月 30 日
I see, well my data clipping issue is resolved it doesn't popup anymore. Except my song doesnt work for some odd reasons because of format problems. I tried using windows media player and vlc media player and won't play the format for some reason. Any ideas?
Star Strider
2014 年 4 月 30 日
It plays perfectly for me.
Add:
soundsc(x)
after the wavread statement to hear it. Playing x rather than fur verifies that it saved and read successfully.
Edgar
2014 年 4 月 30 日
Yes! Its playing! Thanks so much! Now where can I control the song, meaning pause, play, stop, etc? It plays within matlab rather than an external app.
Star Strider
2014 年 4 月 30 日
Great!
I haven’t experimented much with audioplayer, but apparently it has those capabilities. I know that sound and soundsc don’t. If you have audioplayer, experiment with it to see if it will do what you want.
Image Analyst
2014 年 4 月 30 日
Just rename the function calls. But I believe audioplayer() is with the latest, or very recent versions only. At least that's when I started to get warnings to use audioplayer() instead of sound(). If you have R2014a you should be okay.
Star Strider
2014 年 4 月 30 日
If you save the files to a format compatible with Windows Media Player or some such, you should be able to play them through it. I don’t have access to the wavwrite documentation, so you will have to explore that to see. I remember that it was possible to save to different formats, but I don’t have recent experience with wavwrite, so I don’t remember the details. You may also have to ask Windows Media Player what it likes. Earlier versions played ‘.wav’ files.
Walter Roberson
2014 年 4 月 30 日
1E-5 might be lower than eps(abs(fur)). Instead of
fur/max(abs(fur)+eps);
should use
fur/max(abs(fur)*(1+eps));
or alternately
fur/max(abs(fur)+eps) * (1-eps);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)